array-flatten.js
function flattenDepth (array, depth) {
  if (!Array.isArray(array)) {
    throw new TypeError('Expected value to be an array')
  }

  return flattenFromDepth(array, depth)
}
function flattenDepth (array, depth) {
  if (!Array.isArray(array)) {
    throw new TypeError('Expected value to be an array')
  }

  return flattenFromDepth(array, depth)
}
function flattenDepth ( array , depth ) { if ( ! Array . isArray ( array ) ) { throw new TypeError ( 'Expected value to be an array' ) } return flattenFromDepth ( array , depth ) }
Flatten an array-like structure with depth.

@param  {Array}  array
@param  {number} depth
@return {Array}
Flatten an array - like structure with depth .