Basic JavaScript - Manipulate Arrays With unshift()

Tell us what’s happening:
Describe your issue in detail here.
the code doesn’t work can you help me out what’s the issue here ?

Your code so far

// Setup
const myArray = [["John", 23], ["dog", 3]];
myArray.shift();

// Only change code below this line
myArray.unshift("Paul", 35);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Manipulate Arrays With unshift()

Link to the challenge:

To debug your issue, add the following line to the end of your code:

console.log(myArray);

After that, what do you see on your console? Is it what you expected? Does it match [["Paul", 35], ["dog", 3]] exactly?

yeah it matched. Thank you so much.

Oh, were you able to update your code and pass?

With your original code I see an array with three values, "Paul", 35, and ["dog", 3], when the task expects your array to have two values, ["Paul", 35], and ["dog", 3].

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