array-flatten (1.1.1)
Published 2026-02-24 13:52:56 +00:00 by atheaadmin
Installation
registry=npm install array-flatten@1.1.1"array-flatten": "1.1.1"About this package
Array Flatten
Flatten an array of nested arrays into a single flat array. Accepts an optional depth.
Installation
npm install array-flatten --save
Usage
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])
License
MIT
Dependencies
Development Dependencies
| ID | Version |
|---|---|
| istanbul | ^0.3.13 |
| mocha | ^2.2.4 |
| pre-commit | ^1.0.7 |
| standard | ^3.7.3 |
Keywords
array
flatten
arguments
depth