Queue
A simple queue class.
This is an obvious es6 dirivative of Stephen Morley's queue implementation.
Constructor Summary
Public Constructor | ||
public |
Creates a new instance. |
Method Summary
Public Methods | ||
public |
dequeue(): * Dequeues the item at the head of the queue, removing the item. |
|
public |
enqueue(item: *) Enqueues the specified item. |
|
public |
peek(): * Peeks at the item at the head of the queue without removing it. |
Public Constructors
Public Methods
public dequeue(): * source
Dequeues the item at the head of the queue, removing the item.
Return:
* | The item at the head of the queue or |
public enqueue(item: *) source
Enqueues the specified item.
Params:
Name | Type | Attribute | Description |
item | * | An item to put on the queue. |
public peek(): * source
Peeks at the item at the head of the queue without removing it.
Return:
* | The item at the head of the queue or |