Removes a value from the end of a collection, and returns that value.
For a SortedSet
and a Heap
, this is equivalent to removing the maximum value
of the collection.
var array = [1, 2, 3]; array.pop(); array
var heap = new Heap([2, 8, 5]); heap.pop(); heap.toArray();
Adds values to the end of a collection.
Removes a value from the beginning of a collection, and returns that value.
Returns the value at the end of a collection, the value that would be returned by pop()
.