trpika
Last Updated: February 12, 2017
·
3.734K
· jamesh075

How to merge multiple arrays into one - ES6

Very simple way to merge mutiple arrays into one:

const x = [['foo'], ['bar'], ['foobar']];
const y = [].concat(...x);
// y results to [ 'foo', 'bar', 'foobar' ]