Tell us what’s happening:
Describe your issue in detail here.
I am already use pop() on myArray but code is not passing and give the error of pop in myArray
Your code so far
const myArray = [["John", 23], ["cat", 2]];
// Only change code below this line
Your browser information:
User Agent is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/220.127.116.11 Safari/537.36
Link to the challenge:
But why are you doing it that way?
.pop() function to remove the last item from
myArray and assign the popped off value to a new variable,
See the example given in the challenge below:
const threeArr = [1, 4, 6];
const oneDown = threeArr.pop();
here removedFrommyArray is not used .how i use it
I am not going to write the answer for you. That doesn’t help you at all.
Do you know what this line is doing in the example?
it pop out element from array
And…? That is not all that is happening on that line
May pop the last element from array
Right… but that is not everything that is happening on that line. What else is happening on that line?
This pops the element off, but what about this half of the line:
constant contain unchanged value but i dont know about oneDown meaning
Do you know what an
You may be rushing through the curriculum too quickly if you don’t know what the
= is used to assign any value to variable
Right, so what is happening on this entire line? The last element of the array
threeArr is being
poped off, and then…?
Then this is our console output:
That line does not generate console output.
The challenge says:
We can store this popped off value by assigning it to a variable.
Can you see that this line does that?
The line might not what? I don’t understand what you said.