top button
Flag Notify
Site Registration

How does pop()method work in JavaScript?

+4 votes
94 views
How does pop()method work in JavaScript?
posted Jun 15, 2015 by Muskan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+3 votes
 
Best answer

Definition and Usage:

The pop() method removes the last element of an array, and returns that element.

Note: This method changes the length of an array.

Tip: To remove the first element of an array, use the shift() method.

Syntax

array.pop()
answer Jun 15, 2015 by Vrije Mani Upadhyay
...