SyntaxFix
Write A Post
Hire A Developer
Questions
To flatten a two-dimensional array in one line:
[[1, 2], [3, 4, 5]].reduce(Function.prototype.apply.bind(Array.prototype.concat)) // => [ 1, 2, 3, 4, 5 ]