node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

flattenarray

flatten-array

Recursively flatten an array.

Install

npm install flattenarray
bower install flatten-array

Usage

var flatten = require('flatten');
 
console.log(flatten('a')); // ["a"] 
console.log(flatten([[['b']]])); // ["b"] 
console.log(flatten(['a',['b'],['c']])); // ["a","b","c"] 
console.log(flatten([['a'],'b',['c',['d']]])); // ["a","b","c","d"] 

License

MIT