1.0.0 • Published 9 months ago

stack-npm-package v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

Stack

This is a simple stack factory function that provides methods for common stack operations.

Methods

push()

Adds element to the top of the stack.

pop()

Removes and returns the top element from the stack.

peek()

Returns the top element from the stack without removing it.

isEmpty()

Returns true if the stack is empty, false otherwise.

clear()

Removes all elements from the stack, making it empty.

size()

Returns the number of elements currently in the stack.

print()

Prints the elements of the stack in the order they would be popped.

1.0.0

9 months ago