I’m trying to solve the problem here and I’m new tech-industry who just finished with Responsive web design two months ago.
My problem is
// Setup
const myArray = [[“John”, 23], [“cat”, 2]];
// Only change code below this line
var RemovedFromMyArray = myArray.pop();
Thank you very much and I really appreciate that big help, because since I got stuck yesterday trying to get the solution but I failed. This has given me courage.
How can I use .pop() function to remove the last item from myArray and assign the popped off value to a new variable, removedFromMyArray.?
Because I tried to change the code however I could but failed, someone please help…!
Your code so far
// Setup
const myArray = [["John", 23], ["cat", 2]];
// Only change code below this line
var RemovedFromMyArray = myArray.pop();
Your browser information:
User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36
Challenge Information:
Basic JavaScript - Manipulate Arrays With pop Method