Basic JavaScript - Manipulate Arrays With push Method

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

// Setup
const myArray = [["John", 23], ["cat", 2]];

// Only change code below this line
var myArray.push (["dog", 3]);

Your browser information:

User Agent is: Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1

Challenge: Basic JavaScript - Manipulate Arrays With push Method

Link to the challenge:

Hello and welcome to the community :smiley:!

You shouldn’t use the ‘var’ keyword here. You are using the push method to add items to an already existing array.

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