Returns true if queue is empty
Is queue full? Returns false if no capacity has been set
Number of items in queue
Returns front of queue (oldest item), or undefined if queue is empty
Dequeues (removes oldest item / item at front of queue). Use peek to get item that will be removed.
Queue with item removed
Returns a new queue with item(s) added
Items to add
Returns a copy of data in queue as an array
Queue (immutable). See also QueueMutable.
Queues are useful if you want to treat 'older' or 'newer' items differently. Enqueing adds items at the back of the queue, while dequeing removes items from the front (ie. the oldest).
Example: Cap size to 5 items, throwing away newest items already in queue.