# Queue

#### new Queue()

Create a FIFO queue data structure.

Source:
  - datastructures/queue.js, line 7

### Methods

#### clear()

Clear the contents of the queue.

Source:
  - datastructures/queue.js, line 22

#### dequeue() → {object}

Get the front element of the queue and removes it from the queue.

Source:
  - datastructures/queue.js, line 38

##### Returns:

Front element from the queue.

Type
  object

#### enqueue(obj)

Push an object in to the queue.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | object | Any object to be pushed into the queue.

Source:
  - datastructures/queue.js, line 30

#### hasNext() → {boolean}

Checks if the queue isn't empty.

Source:
  - datastructures/queue.js, line 57

##### Returns:

Whether or not the queue has another element. True if yes.

Type
  boolean

#### isEmpty() → {boolean}

Checks if the queue is empty.

Source:
  - datastructures/queue.js, line 65

##### Returns:

Whether or not the queue is empty. True if yes.

Type
  boolean

#### peek() → {object}

Get the front element of the queue without removing it from the queue.

Source:
  - datastructures/queue.js, line 48

##### Returns:

Front element from the queue.

Type
  object

#### size() → {number}

Get the number of objects in the queue.

Source:
  - datastructures/queue.js, line 15

##### Returns:

Number of elements in the queue.

Type
  number