PATH:
usr
/
local
/
lib
/
node_modules
/
bower
/
lib
/
node_modules
/
bower-config
/
node_modules
/
mout
/
array
var isArray = require('../lang/isArray'); var append = require('./append'); /* * Helper function to flatten to a destination array. * Used to remove the need to create intermediate arrays while flattening. */ function flattenTo(arr, result, level) { if (level === 0) { append(result, arr); return result; } var value, i = -1, len = arr.length; while (++i < len) { value = arr[i]; if (isArray(value)) { flattenTo(value, result, level - 1); } else { result.push(value); } } return result; } /** * Recursively flattens an array. * A new array containing all the elements is returned. * If level is specified, it will only flatten up to that level. */ function flatten(arr, level) { if (arr == null) { return []; } level = level == null ? -1 : level; return flattenTo(arr, [], level); } module.exports = flatten;
[-] compact.js
[edit]
[-] find.js
[edit]
[-] equals.js
[edit]
[-] union.js
[edit]
[-] intersection.js
[edit]
[-] shuffle.js
[edit]
[-] reduce.js
[edit]
[-] max.js
[edit]
[+]
..
[-] collect.js
[edit]
[-] unique.js
[edit]
[-] combine.js
[edit]
[-] split.js
[edit]
[-] contains.js
[edit]
[-] forEach.js
[edit]
[-] some.js
[edit]
[-] pluck.js
[edit]
[-] insert.js
[edit]
[-] flatten.js
[edit]
[-] lastIndexOf.js
[edit]
[-] findLastIndex.js
[edit]
[-] take.js
[edit]
[-] append.js
[edit]
[-] removeAll.js
[edit]
[-] reduceRight.js
[edit]
[-] pick.js
[edit]
[-] min.js
[edit]
[-] groupBy.js
[edit]
[-] zip.js
[edit]
[-] toLookup.js
[edit]
[-] indexOf.js
[edit]
[-] findLast.js
[edit]
[-] slice.js
[edit]
[-] reject.js
[edit]
[-] range.js
[edit]
[-] remove.js
[edit]
[-] indicesOf.js
[edit]
[-] sortBy.js
[edit]
[-] last.js
[edit]
[-] sort.js
[edit]
[-] map.js
[edit]
[-] findIndex.js
[edit]
[-] reverse.js
[edit]
[-] join.js
[edit]
[-] filter.js
[edit]
[-] every.js
[edit]
[-] invoke.js
[edit]
[-] difference.js
[edit]
[-] xor.js
[edit]