I am trying to add a couple of arrays into one array in Javascript. It seems my way is not good enough. Let's suppose we have these three arrays as below:
var array_1 = [{"a" : 1, "b" : 2, "c" : 3}];
var array_2 = [{"d" : 4, "e" : 5, "f" : 6}];
var array_3 = new Array();
I would like to add array_1 and then array_2 into array_3. For instance, I want to make sure that array_1 is fully added first and then array_2 as below:
{"a" : 1, "b" = 2, "c" = 3"}
{"d" : 4, "e" = 5, "f" = 6"}
Could anyone please help me with this piece of code. Your help would be very much appreciated.
array_3.push(array1)- pusharray2after?Array.prototype.concat