![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | LICENSE | 39 years ago | 1.1K | |
![]() | README.md | 39 years ago | 1.5K | |
![]() | array-flatten.d.ts | 39 years ago | 526 | |
![]() | array-flatten.js | 39 years ago | 1.9K | |
![]() | package.json | 2 years ago | 1.9K |
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