This wont run and I cant figure it out

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/96.0.4664.45 Safari/537.36

Challenge: Manipulate Arrays With push()

Link to the challenge:

sorry I dont think this came up properly,I need to push dog onto a sentence. I am trying by putting [ β€œdog”, 3} as myVar

You need to use β€œ()”
And in general pay more attention to brackets. Like, in you second comment you again mix different types [}- make sure you don’t hit wrong keys on the keyboard while coding.

1 Like

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