myArray.push problem

Hello! Can anyone answer why I can’t complete this challenge? I wrote the code correctly, AFAIK but still no success.
The objective is to
Push ["dog", 3] onto the end of the myArray variable.

Your code so far

x// Setup
var 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/94.0.4606.61 Safari/537.36

Challenge: Manipulate Arrays With push()

Link to the challenge:

x// Setup remove the x

x is seen as an undefined identifier which will cause a reference error as you can see in the output

ReferenceError: x is not defined

thanks you very much!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.