Array.pop

Removes the last element from an array and returns that element. This method changes the length of the array.
Method of Array

Syntax

pop()

Parameters

None.

Example

The following code creates the myFish array containing four elements, then removes its last element.

See also

Array.push, Array.shift, Array.unshift

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.