Extracted from Pike v7.8 release 866 at 2016-11-06.
pike.ida.liu.se
[Top]
Array

Method Array.pop()


Method pop

array pop(array list)

Description

Pops and returns the last value of the array, shortening the array by one element. If there are no elements in the array then 0 is returned otherwise an array is returned where the first returned element is the popped value, and the second element is the modified array.

Example

Array.pop(({ "a", "b", "c", "d" })); > ({ "d", ({ "a", "b", "c" }) })

See also

ADT.Stack , ADT.Stack.pop , ADT.Stack.quick_pop