Name | Last modified | Size | Description | |
---|---|---|---|---|
Parent Directory | - | |||
LICENSE | a year ago | 1.1K | f0d2fc9 test post-receive hook [كارل مبارك] | |
package.json | a year ago | 879 | 120707f added node version q18.16 to dependincies [كارل مبارك] | |
README.md | a year ago | 1.2K | 15de0e0 styling, texts [كارل مبارك] | |
array-flatten.js | a year ago | 1.2K |
Flatten an array of nested arrays into a single flat array. Accepts an optional depth.
npm install array-flatten --save
var flatten = require('array-flatten')
flatten([1, [2, [3, [4, [5], 6], 7], 8], 9])
//=> [1, 2, 3, 4, 5, 6, 7, 8, 9]
flatten([1, [2, [3, [4, [5], 6], 7], 8], 9], 2)
//=> [1, 2, 3, [4, [5], 6], 7, 8, 9]
(function () {
flatten(arguments) //=> [1, 2, 3]
})(1, [2, 3])
MIT