Stack

Monster.Types. Stack

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.30.0/dist/monster.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.30.0/dist/modules/types/stack.js';
console.log(new Stack())
</script>

Constructor

# new Stack()

Since:
  • 1.4.0

Methods

# clear() → {Queue}

remove all entries

Returns:
Type
Queue

# isEmpty() → {boolean}

Returns:
Type
boolean

# peek() → {*}

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

Returns:
Type
*

# pop() → {*}

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}

pushes an item onto the top of this stack.

Parameters:
Name Type Description
value *
Returns:
Type
Queue