Tell us what’s happening:
Describe your issue in detail here.
I have a silly question. In the sample code, I am presented with two push examples. The first “arr1.push(4, 5);” utilises only parentheses, while the second utilises both parentheses and brackets (). I wonder why the difference? Couldn’t the second one simply have been written as arr2.push(“happy”, “joy”); and still have worked?
I thank you for your time and kindness!
Your code so far
const arr1 = [1, 2, 3];
arr1.push(4, 5);
const arr2 = ["Stimpson", "J", "cat"];
arr2.push(["happy", "joy"]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Challenge Information:
Basic JavaScript - Manipulate Arrays With push Method