Basic JavaScript - Manipulate Arrays With unshift()

Tell us what’s happening:
Describe your issue in detail here.
Good day freecodecamp
please i don’t know where am wrong while the output is exactly what was required, please enlighten me.
thanks

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);

Your browser information:

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

Challenge: Basic JavaScript - Manipulate Arrays With unshift()

Link to the challenge:

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

Capitalization in your string must match exactly

1 Like

same issue sir.
did exactly what you said but it keeps telling me myArray should now have [ [“paul”, 35], [“dog”, 3]] .
please what is the issue

You fixed this string here?

yes sir i did but still not getting through

What is your updated code?

// Setup

const myArray = [[“John”, 23], [“dog”, 3]];

myArray.shift();

// Only change code below this line

myArray.shift([“paul”, 35]);

this is it sir

You haven’t fixed the string as @JeremyLT pointed out.

The tests want to see Paul, but your code has paul. You need to capitalize the name.

1 Like

It looks like the string is identical to the one I said was wrong? In what way did you change it?

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