Last Updated: February 12, 2017
·
7.076K
· 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' ]