Stack

Members

itemsArray

Items collection.

Methods

isEmpty(){boolean}

Check if the stack is empty.

Returns: {boolean}

peek(){*}

Return the last element from the stack (without modification stack).

Returns: {*}

pop(){*}

Remove the last element from the stack and returns it.

Returns: {*}

push(items)

Add new item or items at the back of the stack.

Parameters:
Name Type Description
items * repeatable

An item to add.

size(){number}

Return number of elements in the stack.

Returns: {number}
Class: Stack