Class: Stack

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}