Have I got this code totally wrong

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

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

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.45 Safari/537.36

Challenge: Manipulate Arrays With pop()

Link to the challenge:

You seem to have accidentally deleted the prompt to tell us about what problem you are having. Can you describe what you need help with?

I need to use pop. to remove [“cat” 2] but I cant figure it out

Well, how does your code differ from the example:

const threeArr = [1, 4, 6];
const oneDown = threeArr.pop();
1 Like

I just added var at the end and it worked,thank you

I am not quite sure what this means, but I’m glad your code seems to be working.

You shouldn’t really use var. You should use const instead of var.

You should have also deleted some part of your code.

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