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
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

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

2 Likes

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();

1 Like

Hello @Zedrick2022

A small typing error. The r in removed should not be a capital.
Try that and see if it works for you.

Happy coding

2 Likes

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.

2 Likes

Tell us what’s happening:

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

Consider the new variable name.
This is the one you used.

RemovedFromMyArray

This is the recommended one.

removedFromMyArray
1 Like

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