Class: Stack

Stack()

Stack Class

Constructor

new Stack()

Source:

Members

isEmpty

Returns true/false if stack is empty
Source:

peek

Peek next element
Source:

size

Returns number of elements
Source:

Methods

clear()

Removes all the elements in the stack
Source:

pop() → {any}

Retrieves and remove next element
Source:
Returns:
element
Type
any

push(val)

Push a new value to the stack
Parameters:
Name Type Description
val any
Source:

toArray() → {Array}

Converts and return an array from stack
Source:
Returns:
Type
Array