Recursively flatten arrays!
npm install just-flatten
var flatten = require('just-flatten')
flatten([[1,2,[3]],4]) // => [1,2,3,4]
The function expects a single argument: an array to be flattened. Any other value is returned as-is.
Recursively flatten arrays!
npm install just-flatten
var flatten = require('just-flatten')
flatten([[1,2,[3]],4]) // => [1,2,3,4]
The function expects a single argument: an array to be flattened. Any other value is returned as-is.