MCPcopy
hub / github.com/lodash/lodash / flatten

Function flatten

lodash.js:7420–7423  ·  view source on GitHub ↗

* Flattens `array` a single level deep. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flatten([1, [2, [3, [4]], 5]]);

(array)

Source from the content-addressed store, hash-verified

7418 * // => [1, 2, [3, [4]], 5]
7419 */
7420 function flatten(array) {
7421 var length = array == null ? 0 : array.length;
7422 return length ? baseFlatten(array, 1) : [];
7423 }
7424
7425 /**
7426 * Recursively flattens `array`.

Callers

nothing calls this directly

Calls 1

baseFlattenFunction · 0.85

Tested by

no test coverage detected