Queue

Monster/Types. Queue

queue class

you can call the method via the monster namespace new Monster.Types.Queue().

<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.5.0/dist/modules/types/queue.js';
console.log(new Monster.Types.Queue())
</script>

Alternatively, you can also integrate this function individually.

<script type="module">
import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.5.0/dist/modules/types/queue.js';
console.log(new Queue())
</script>

Constructor

new Queue()

Source:
Since:
  • 1.4.0

Methods

add(value) → {Queue}

Source:

Add a new element to the end of the queue.

Parameters:
Name Type Description
value *
Returns:
Type
Queue

clear() → {Queue}

Source:

remove all entries

Returns:
Type
Queue

isEmpty() → {boolean}

Source:
Returns:
Type
boolean

peek() → {*}

Source:

Read the element at the front of the queue without removing it.

Returns:
Type
*

poll() → {*}

Source:

Remove the element at the front of the queue If the queue is empty, return undefined.

Returns:
Type
*