Skip to content

Instantly share code, notes, and snippets.

@Floby
Last active December 15, 2015 06:09
Show Gist options
  • Save Floby/5214089 to your computer and use it in GitHub Desktop.
Save Floby/5214089 to your computer and use it in GitHub Desktop.
a queue?
function Queue () {
if(!(this instanceof Queue)) return new Queue();
}
Queue.prototype.push = function push(e) {
return this._q.unshift(e);
};
Queue.prototype.shift = function shift() {
return this._q.pop();
};
module.exports = Queue;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment