mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-22 08:25:14 +00:00
.. | ||
index.js | ||
LICENSE | ||
package.json | ||
README.md | ||
test.js |
flatten
A tiny utility to flatten arrays of arrays (of arrays, etc., recursively, infinitely or to an optional depth) into a single array of non-arrays.
example:
> var flatten = require('flatten');
undefined
> flatten([1, [2, 3], [4, 5, 6], [7, [8, 9]], 10])
[ 1,
2,
3,
4,
5,
6,
7,
8,
9,
10 ]
> flatten([1, [2, [3, [4, [5]]]]], 2)
[ 1,
2,
3,
[ 4, [ 5 ] ] ]
install:
npm install flatten
license:
MIT/X11.