Basic JavaScript - Manipulate Arrays With pop Method

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

Your code so far

// Setup
const myArray = [["John", 23], ["cat", 2]];

// Only change code below this line
const myArray = [["John" , 23]] ["cat" , 2]];
removedFromMyArray = myArray.pop()
removedFromMyArray=myArray[1];

Your browser information:

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

Challenge: Basic JavaScript - Manipulate Arrays With pop Method

Link to the challenge:

You don’t need to redefine myArray and you can’t anyway since it is defined with const. So get rid of the second one you added.

This looks pretty good but you need to declare the variable removedFromMyArray properly, which means using either let or const to define it.

What is the purpose of this line?

1 Like

I think this exercise has a problem. I did everything correct and it is showing an error. I doublechecked spelling and still does not work. There have been a couple of posts on this same exercise and each time the post is answered differently but I think the main problem is a bug or something in that page.