Skip to content

Latest commit

 

History

History
125 lines (61 loc) · 1.4 KB

Stack.md

File metadata and controls

125 lines (61 loc) · 1.4 KB

Stack.Stack

clear()

Remove all items from the stack


constructor([items])

Arguments

  1. [items] (array): an array of items to push onto the stack

peek()

Return the top item of the stack

Returns

(*): the top item on the stack


pop()

Remove and return the top item of the stack

Returns

(*): removes and returns the item on the top of the stack


push(item)

Add an item to the top of the stack

Arguments

  1. item (*): an item to push onto the stack

pushAll(items)

Add multiple items to the stack

Arguments

  1. items (*[]): an array of items to push onto the stack

size

(number): The number of items in the stack