An ordered structure of data inputs obeying the principle of last in, first out.
yarn add @datastructures/stack -Dimport { stack } from '@datastructures/stack'
const pancake = stack()
pancake.add('one pancaka')
pancake.add('two pancaka')
// I'm so hungry
pancake.remove() // yum, pancaka remove
pancake.print() // one pancakaadd(item) adds an item to the queue
ex:
queue.add('foo')remove()removes the last item from the queue ex:queue.remove()length()returns the length of the queueprint()prints all items in the queue
Functional typed data structures offering structure clarity and simplicity.