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

NPM version NPM downloads Build status Test coverage

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
Details
npm
2026-02-24 13:52:56 +00:00
1
Blake Embrey
MIT
latest
1.9 KiB
Assets (1)
Versions (1) View all
1.1.1 2026-02-24