Tell us what’s happening:
Hi
How do I go about using the poop function to take an item of the end of a list and declare a new variable with the altered array?
I thought maybe, cosole.log(newArray.pop(3)) for example but it just prints the value being taken off>
Your code so far
// Setup
var myArray = [["John", 23], ["cat", 2]];
// Only change code below this line
var removedFromMyArray = myArray.pop()
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.56
.
Challenge: Manipulate Arrays With pop()
Link to the challenge: