Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

pop

The pop() method of the Array object removes the last element in an array and returns that element to the script. The array is affected by having its last element removed.

Syntaxarray.pop()

Examples

var arr = ["a","b","c","d","e"]; var last = arr.pop(); alert(last); /* e */ alert(arr); /* a,b,c,d */

JavaScript

Methods

addEventListeneralertaveragebackblurconcatcreatedecodeURIdecodeURIComponentencodeURIencodeURIComponentevaleveryfilterforwardgoisArrayisFiniteisNaNjoinparseFloatparseIntpoppushpushStatereducereplaceStatereverseshiftshuffleslicesomesortspliceunshiftwrite