Node.js examples for Array:Flatten
flat an array
var flattenArrays = [[1, 2, 3], [4, 5], [6]]; function flatten(array) { return array.reduce(function(a,b) { console.log(a,b);/*from ww w.j av a2 s . co m*/ return a.concat(b); }) } console.log(flatten(flattenArrays))