vlad 6f123ff03e 18.07 | %!s(int64=6) %!d(string=hai) anos | |
---|---|---|
.. | ||
LICENSE | %!s(int64=6) %!d(string=hai) anos | |
README.md | %!s(int64=6) %!d(string=hai) anos | |
array-flatten.d.ts | %!s(int64=6) %!d(string=hai) anos | |
array-flatten.js | %!s(int64=6) %!d(string=hai) anos | |
package.json | %!s(int64=6) %!d(string=hai) anos |
Flatten nested arrays.
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.depth([1, [2, [3, [4, [5], 6], 7], 8], 9], 2)
//=> [1, 2, 3, [4, [5], 6], 7, 8, 9]
(function () {
flatten.from(arguments) //=> [1, 2, 3]
})(1, [2, 3])
MIT