es6 concat trick

let a = [1], b = [2], c = [3],
    d = [...a, ...b, ...c];
console.log(d);
// outputs: [1, 2, 3]
This entry was posted in arrays, es6, javascript and tagged . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*