Class: Queue

Queue

Members

itemsArray

Items collection.

Methods

dequeue(){*}

Remove the first element from the queue and returns it.

Returns: {*}

enqueue(items)

Add new item or items at the back of the queue.

Parameters:
Name Type Description
items * repeatable

An item to add.

isEmpty(){Boolean}

Check if the queue is empty.

Returns: {Boolean}

peek(){*}

Return the first element from the queue (without modification queue stack).

Returns: {*}

size(){Number}

Return number of elements in the queue.

Returns: {Number}