Basic JavaScript - Manipulate Arrays With unshift Method

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

Example:

const ourArray = ["Stimpson", "J", "cat"];
ourArray.shift();
ourArray.unshift("Happy");

After the shift, ourArray would have the value ["J", "cat"]. After the unshift, ourArray would have the value ["Happy", "J", "cat"].


Add ["Paul", 35] to the beginning of the myArray variable using unshift().
Your code so far

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

// Only change code below this line
myArray.unshift(["paul",35]);
console.log(myArray);

I did exactly what i was asked to do but i don’t see to know what is the problem. Can someone please help me out. :sweat_smile:
I have checked other forums but none seems to help me out. :roll_eyes:
Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Manipulate Arrays With unshift Method

Link to the challenge:

Hmm, this isn’t quite the same as the text requested! That first letter is a little different!

Oh Thanks, i just realised that my “p” in Paul was in small letter instead of Capital letter. :sweat_smile:

1 Like

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