The Queue class implements the functionality of a queue - more specifically, a FIFO (first-in, first-out) queue.
Constructs a new queue, optionally with the specified elements.
elements
Rest
Elements to add to the queue.
Gets the length of the queue.
Returns an iterator that allows iterating over all elements in the queue.
Removes all entries from this instance.
Returns the front (first) element from the queue. If the queue is empty, undefined is returned and the queue is not modified.
The front element or undefined if empty.
Removes the front (first) element from the queue and returns it. If the queue is empty, undefined is returned and the queue is not modified.
Appends a new element to the end of the queue, and returns the new length of the queue.
element
Converts this instance to a string.
The Queue class implements the functionality of a queue - more specifically, a FIFO (first-in, first-out) queue.