Node.js examples for Array:Flatten
Flatten array
export function flatten(a) { const target = [];/*from w w w . ja va 2 s. c om*/ for (let i = 0; i < a.length; ++i) { for (let j = 0; j < a[i].length; ++j) { target.push(a[i][j]); } } return target; }