Queue

external class Queue(source)

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

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val length: Int

The length of the queue.

Functions

Link copied to clipboard
fun clear()

Remove all items from the queue.

Link copied to clipboard
fun contains(item: Any)

Check whether this queue contains the specified item.

Link copied to clipboard
fun dequeue(): Any

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

Link copied to clipboard
fun enqueue(item: Any)

Enqueues the specified item.

Link copied to clipboard
fun peek(): Any

Returns the item at the front of the queue. Returns undefined if the queue is empty.

Link copied to clipboard
fun sort(compareFunction: Comparator)

Sort the items in the queue in-place.