+ 2
How do you use the push() method to add an entire array to another array?
Array methods
3 Answers
+ 3
Javascript?
Create the array separately, then push it into the other array like any other item.
+ 2
Like this ?
var c1 = [56, 20, "Loren"];
var c2 = [63, 94, "khalid"];
c1.push(c2);
console.log(c1);
Tried this several time, it outputs undefined ...
+ 2
I just copypasted your code snippet and ran it - it worked!