Members
depth
Returns the number of items in the stack
- Source:
Methods
peek() → {any}
Retrieve the item from the top of the stack
- Source:
pop() → {any}
Remove element from the stack. Returns the removed value.
Runtime: O(1)
- Source:
push(item) → {Stack}
Add element to the stack. Returns the Stack instance to allow
the push()
calls to be chained.
Runtime: O(1)
Parameters:
Name | Type | Description |
---|---|---|
item |
any |
- Source: