Stack

A manager for temporarily storing mass data in sequence.

To create a new Stack instance, initialise the class like below.

const ST = new QDB.Stack(Iterable?);

Properties

.Values

Private

Main structure holding the Stack values.
Type - Array

.Size

Current size of this Stack.
Type - Number

Methods

.Push(ValueOrArr)

Pushes a new item or items to this data Stack.

Parameter Type Description
ValueOrArr Any | Array Either a value or an array of values to push to this Stack.

Returns - Number
The new size of the Stack.

.Pop(Amount?)

Pops an amount from this data Stack.

Parameter Type Description
Amount Number Amount to pop from the Stack.

Returns - Any | Array
TPopped value or an array with popped values.

.Seek(PointerOffset?)

Returns the last or an item in this data Stack.

Parameter Type Description
PointerOffset Number Amount of offset to the read/write pointer to seek from.

Returns - Any | Array
Popped value or an array with popped values.

.Flush()

Completely flushes this data Stack.

Returns - Array