Skip to content

floatdrop/flatit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ([email protected])

About

Another flatten implementation for arrays

Resources

Stars

Watchers

Forks

Packages

No packages published