Returns the value at the beginning of a collection, the value that would be returned by shift()
.
var array = [1, 2, 3]; array.peek();
Replaces the value at the beginning of a collection, the value that would be returned by shift()
.
Returns the value at the end of a collection, the value that would be returned by pop()
.
Removes a value from the beginning of a collection, and returns that value.