MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / flatten

Function flatten

lib/web/jshint.js:6454–6460  ·  view source on GitHub ↗

* Flattens a nested array. If `isDeep` is `true` the array is recursively * flattened, otherwise it is only flattened a single level. * * @static * @memberOf _ * @category Array * @param {Array} array The array to flatten. * @param {boolean} [isDeep] Specify a deep

(array, isDeep, guard)

Source from the content-addressed store, hash-verified

6452 * // => [1, 2, 3, 4]
6453 */
6454 function flatten(array, isDeep, guard) {
6455 var length = array ? array.length : 0;
6456 if (guard && isIterateeCall(array, isDeep, guard)) {
6457 isDeep = false;
6458 }
6459 return length ? baseFlatten(array, isDeep) : [];
6460 }
6461
6462 /**
6463 * Recursively flattens a nested array.

Callers

nothing calls this directly

Calls 2

isIterateeCallFunction · 0.85
baseFlattenFunction · 0.85

Tested by

no test coverage detected