Skip to content

Latest commit

 

History

History
125 lines (61 loc) · 1.43 KB

Queue.md

File metadata and controls

125 lines (61 loc) · 1.43 KB

Queue.Queue

clear()

Remove all items from the 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 (*[]): 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