array.pop [method]

array.pop()

removes one item from the end of array or emits a warning if there are no items in the array, returns the removed item

a = [ 5 ];
a.pop(); // array is empty now
a.pop(); // warning: "array is empty, cannot pop"