3 [![NPM version][npm-image]][npm-url]
4 [![NPM downloads][downloads-image]][downloads-url]
5 [![Build status][travis-image]][travis-url]
6 [![Test coverage][coveralls-image]][coveralls-url]
8 > Flatten an array of nested arrays into a single flat array. Accepts an optional depth.
13 npm install array-flatten --save
19 var flatten = require('array-flatten')
21 flatten([1, [2, [3, [4, [5], 6], 7], 8], 9])
22 //=> [1, 2, 3, 4, 5, 6, 7, 8, 9]
24 flatten([1, [2, [3, [4, [5], 6], 7], 8], 9], 2)
25 //=> [1, 2, 3, [4, [5], 6], 7, 8, 9]
28 flatten(arguments) //=> [1, 2, 3]
36 [npm-image]: https://img.shields.io/npm/v/array-flatten.svg?style=flat
37 [npm-url]: https://npmjs.org/package/array-flatten
38 [downloads-image]: https://img.shields.io/npm/dm/array-flatten.svg?style=flat
39 [downloads-url]: https://npmjs.org/package/array-flatten
40 [travis-image]: https://img.shields.io/travis/blakeembrey/array-flatten.svg?style=flat
41 [travis-url]: https://travis-ci.org/blakeembrey/array-flatten
42 [coveralls-image]: https://img.shields.io/coveralls/blakeembrey/array-flatten.svg?style=flat
43 [coveralls-url]: https://coveralls.io/r/blakeembrey/array-flatten?branch=master