To remove the last item from an array and the n assign it to new variable, what have I done wrong?

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 removedFromArray = myArray.pop();
console.log(removedFromArray);

Your browser information:

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

Challenge: Manipulate Arrays With pop()

Link to the challenge:

You need to assign it to a variable named removedFromMyArray.

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