LIFO(Last In First Out) data structure.
const stack = new Stack(); stack.push(123); console.log(stack.pop()); // 123
Returns top value of the stack. Throws an error if the stack is empty.
Returns top value of the stack and remove it. Throws an error if the stack is empty.
Adds value to the stack.
value
Generated using TypeDoc
LIFO(Last In First Out) data structure.
const stack = new Stack(); stack.push(123); console.log(stack.pop()); // 123