Basic JS: Manipulate Arrays With shift()

Tell us what’s happening:
I can’t seem to get this right and I don’t understand what I’m doing wrong.

It just says removedFromMyArray should contain ["John", 23] . But console.log(removedFromMyArray’ prints [‘John’, 23]

Can anyone help?

Your code so far

// Setup
const myArray = [["John", 23], ["dog", 3]];

// Only change code below this line
const removedFromOurArray = myArray.shift();

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.110 Safari/537.36 OPR/82.0.4227.50

Challenge: Manipulate Arrays With shift()

Link to the challenge:

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Hi @aschmim !

Welcome to the forum!

Read through the error message more carefully here

then read through what you wrote instead

Once you fix that, then it will pass.

1 Like

Thank you! I knew it was something super simple but I couldn’t see the woods from the trees.

Thanks again!

1 Like

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