An ordered structure of data inputs obeying the principle of first in, first out.
yarn add @datastructures/queue -Dimport { queue } from '@datastructures/queue'
const todo = queue()
todo.add('do laundry')
todo.add('wash car')
todo.remove()
todo.print() // => 'wash car'
todo.length() // => 1add(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.