The fastest javascript implementation of a double-ended queue. Used by the official Redis, MongoDB, MariaDB & MySQL libraries for Node.js and many other libraries.
Push does not appear to accept many arguments, so numbers should be separately added in the example for new Denque(). This is a minor issue, but bothersome since it is the first example after quick start. Currently the example leads to this behavior:
var denque = new Denque();
denque.push(1, 2, 3);
denque.shift(); //1
denque.pop(); // undefined as 3 was never added
The push implementation should be changed though to support push(...items) - to match Array.push() behaviour - I will get it looked at as soon as I can as well.
Push does not appear to accept many arguments, so numbers should be separately added in the example for
new Denque()
. This is a minor issue, but bothersome since it is the first example after quick start. Currently the example leads to this behavior:This issue is also reflected on https://www.npmjs.com/.