Home | Mailing List | Blog | Tutorial Videos

Merge Two Arrays

Consider two arrays a and b below. Which option below is NOT correct to merge the arrays?

var a = [1,2,3];
var b = [4,5,6];

// A 
console.log(a.concat(b));    

// B
console.log([...a, ...b]);   

// C
console.log(a + b);

Select one: