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' ]
Written by jamesh075
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Es6
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#