Queue

Queue

new

A queue that can enqueue items at the end, and dequeue items from the front.

Source:

Members

The length of the queue.

Methods

Remove all items from the queue.

Check whether this queue contains the specified item.

Parameters:
Name Type Description
the Object item to search for.

Dequeues an item. Returns undefined if the queue is empty.

Enqueues the specified item.

Parameters:
Name Type Description
item Object The item to enqueue.

Sort the items in the queue in-place.

Parameters:
Name Type Description
compareFunction Function a function that defines the sort order.