node_modules
.bin
accepts
after
array-flatten
LICENSE
README.md
array-flatten.js
package.json
arraybuffer.slice
async-limiter
backo2
base64-arraybuffer
base64id
better-assert
blob
callsite
commander
component-bind
component-emitter
component-inherit
content-disposition
content-type
cookie
cookie-signature
debug
depd
destroy
diff
ee-first
encodeurl
engine.io
engine.io-client
engine.io-parser
escape-html
escape-string-regexp
etag
express
finalhandler
forwarded
fresh
glob
growl
has-binary2
has-cors
http-errors
indexof
inherits
ipaddr.js
isarray
jade
lru-cache
media-typer
merge-descriptors
methods
mime
mime-db
mime-types
minimatch
minimist
mkdirp
mocha
ms
negotiator
net
object-component
on-finished
parseqs
parseuri
parseurl
path-to-regexp
proxy-addr
qs
quick-local-ip
range-parser
safe-buffer
send
serve-static
setprototypeof
sigmund
socket.io
socket.io-adapter
socket.io-client
socket.io-parser
statuses
supports-color
to-array
to-iso-string
type-is
ultron
unpipe
utils-merge
vary
ws
xmlhttprequest-ssl
yeast
public
README.md
index.js
package-lock.json
package.json
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