Stack
Very simple code Modern code Junior friendly Typescript Made with 💛
yarn add @amaui/stack
- Reversing
- Undo/redo
- Backtracking
- Call stack
- etc.
import AmauiStack from '@amaui/stack';
// Make a new stack instance
const amauiStack = new AmauiStack();
// Add values
amauiStack.push(1, 2, 3, 4);
amauiStack.first;
// 4
amauiStack.length;
// 4
const value = amauiStack.pop();
value;
// 4
amauiStack.first;
// 3
amauiStack.length;
// 3
Install
yarn
Test
yarn test
Build
yarn build