Stack

Monster/Types. Stack

Stack class

you can call the method via the monster namespace new Monster.Types.Queue().

<script type="module">
import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.5.0/dist/modules/types/stack.js';
console.log(new Monster.Types.Stack())
</script>

Alternatively, you can also integrate this function individually.

<script type="module">
import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.5.0/dist/modules/types/stack.js';
console.log(new Stack())
</script>

Constructor

new Stack()

Source:
Since:
  • 1.4.0

Methods

clear() → {Queue}

Source:

remove all entries

Returns:
Type
Queue

isEmpty() → {boolean}

Source:
Returns:
Type
boolean

peek() → {*}

Source:

looks at the object at the top of this stack without removing it from the stack.

Returns:
Type
*

pop() → {*}

Source:

removes the object at the top of this stack and returns that object as the value of this function. is the stack empty the return value is undefined.

Returns:
Type
*

push(value) → {Queue}

Source:

pushes an item onto the top of this stack.

Parameters:
Name Type Description
value *
Returns:
Type
Queue