Tell us what’s happening:
Hi,
So basically I provided the solution:
adding the line “myArray.Push([“dog”, 3]);”
And the it’s telling me it’s wrong.
I browsed the forum but couldn’t find a solution for this or the correct answer.
I have to add the array [“dog”,3] at the end of my array. So it would be “myArray.Push([“dog”, 3]);” right?
I’m pretty confident that it’s the correct answer, please let me know if I’m missing something. The syntax is correct and idk it just seems random that it wont take it.
Your code so far
// Setup
const myArray = [[“John”, 23], [“cat”, 2]];
// Only change code below this line
myArray.Push([“dog”,3]);
// Setup
const myArray = [["John", 23], ["cat", 2]];
// Only change code below this line
myArray.Push(["dog",3]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 OPR/91.0.4516.106
Challenge: Basic JavaScript - Manipulate Arrays With push()
Link to the challenge: