A simple FIFO queue implementation to avoid having to do
on an array, which is slow. It's implemented in the straightforward
root -> node1 -> node2 -> etc.
architecture that we all remember from CS 101.
This can typically be used as a drop-in replacement for an array, and it's only 38 lines of code.
npm install tiny-queue
var Queue = ;var queue = ;queue;queue;queue; // 'foo'queue; //'bar'queuelength; // 0queue; // undefined
Queue object, once instantiated, only supports
queuequeuequeue // returns a regular Arrayqueuelength
So it's basically a drop-in replacement for most naïve usages of an array as a queue.