Skip to content

Latest commit

 

History

History
110 lines (54 loc) · 1.28 KB

File metadata and controls

110 lines (54 loc) · 1.28 KB

Queue.Queue

constructor([items])

Arguments

  1. [items] (Array): an array of items to add to the queue

dequeue()

Remove and return the first item in the queue

Returns

(*): removes and returns the last item in the queue


enqueue(item)

Add an item to the end of the queue

Arguments

  1. item (*): an item to add to the queue

enqueueAll(items)

Add multiple items to the end of the queue

Arguments

  1. items (Array): an array of items to be added to the queue

peek()

Return the first item in the queue

Returns

(*): the last item in the queue


size

(number): The number of items in the queue