Manipulate Arrays With shift()

I entered the code below,but seems to be incorrect,can anyone show me the correct way?thanks

Your code so far


// Example
var ourArray = ["Stimpson", "J", ["cat"]];
removedFromOurArray = ourArray.shift();
// removedFromOurArray now equals "Stimpson" and ourArray now equals ["J", ["cat"]].

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

// Only change code below this line.
var removedFromMyArray = myArray.shift();


Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-shift

thank you for your reply. Problem solved:)

var removedFromMyArray = myArray.shift();
and
removedFromMyArray = myArray.shift();

both don’t work for me, anyone got any suggestions? Is it still bugged?

2 Likes

Not working for me either :frowning:

Have you tried putting a var in front of removedFromOurArray?

I did, but it won’t let me pass.

EDIT: read your post wrong. Tried it, and that works :slight_smile: That must be something to look at though, I was only looking at my code below the line.