Classes
Methods
peek(firstopt) → {any}
Retrieves the first item of this Queue.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
first |
boolean |
<optional> |
true | If false, retrieves the last item instead. |
- Source:
Returns:
The retrieved item.
- Type
- any
poll(firstopt) → {any}
Extracts (removes and returns) the first item of this Queue.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
first |
boolean |
<optional> |
true | If false, extracts the last item instead. |
- Source:
Returns:
The extracted item.
- Type
- any
reverse() → {Each.<any>}
Provides an iterable reversed view of this Queue.
- Source:
Returns:
An iterable over the queue's elements in reverse order.
- Type
- Each.<any>
select(n, firstopt) → {Array.<any>}
Selects and keeps the first n items of the queue, removing all other items.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
n |
number | Number of items to keep in the queue |
||
first |
boolean |
<optional> |
true | If true, selects items from the start; if false, from the end. |
- Source:
Returns:
An array containing the discarded items removed from the queue.
- Type
- Array.<any>