flatit

Faltten array


Keywords
Flatten, array
License
MIT
Install
npm install flatit@1.1.1

Documentation

flatit Build Status

Another implementation of array flatterization. Works recursivly down every nested array.

Usage

var flat = require('flatit');

flat([]); // []
flat([1,2,3,4,5]); // [1,2,3,4,5]
flat([1,2,3,[],4,5]); // [1,2,3,4,5]
flat([1,2,3,[4,[5],6],7,8]); // [1,2,3,4,5,6,7,8]

API

flat(array)

Returns flattened array.

Benchmarks

Run npm run bench to test it yourself.

License

MIT (c) 2014 Vsevolod Strukchinsky (floatdrop@gmail.com)