MCPcopy
hub / github.com/lodash/lodash / flattenDepth

Function flattenDepth

lodash.js:7464–7471  ·  view source on GitHub ↗

* Recursively flatten `array` up to `depth` times. * * @static * @memberOf _ * @since 4.4.0 * @category Array * @param {Array} array The array to flatten. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened arr

(array, depth)

Source from the content-addressed store, hash-verified

7462 * // => [1, 2, 3, [4], 5]
7463 */
7464 function flattenDepth(array, depth) {
7465 var length = array == null ? 0 : array.length;
7466 if (!length) {
7467 return [];
7468 }
7469 depth = depth === undefined ? 1 : toInteger(depth);
7470 return baseFlatten(array, depth);
7471 }
7472
7473 /**
7474 * The inverse of `_.toPairs`; this method returns an object composed

Callers

nothing calls this directly

Calls 2

toIntegerFunction · 0.85
baseFlattenFunction · 0.85

Tested by

no test coverage detected