ObjectQueue

ObjectQueue

Members

length :number

Source:

Number of items in the queue

Type:
  • number

Methods

peek() → {T|undefined}

Source:
Returns:

The first item in the queue or undefined if empty

Type
T | undefined

pop() → {T|undefined}

Source:

Removes the item at the end of the queue and returns it

Returns:

The removed item or undefined if empty

Type
T | undefined

push(item) → {number}

Source:

Adds an item to the end of the queue

Parameters:
Name Type Description
item T

Item to add to the end of the queue

Returns:

New queue length

Type
number

shift() → {T|undefined}

Source:

Removes the item at the start of the queue and returns it

Returns:

The removed item or undefined if empty

Type
T | undefined