array.pop Function |
The array.pop function removes and returns the element at the head of the specified array.
array.pop(ident);
ident | An array identifier |
The first element from the array, or null if the array was empty.
The following code snippet demonstrates the use of the function array.pop:
$arr = array.new(1, 2, 3); PRINT $arr; /* [1,2,3] */ PRINT array.pop($arr); /* 1 */ PRINT $arr; /* [2,3] */
array.add - add an element to the tail of an array
array.new - create a new array
array.pop - remove and return the element at the head of the array
array.set_at - modify the data at a specified index of an array
length - get the number of elements in an array