Created
May 19, 2015 16:19
-
-
Save rubeniskov/ffb7e41542c23057cd21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Queue = function(){ | |
return (function(q,p,n,d,e){ | |
return { | |
enqueue : e=function(fn){ | |
q.splice(++p, 0,fn||n); | |
}, | |
dequeue : d=function(){ | |
return (q.shift()||n).call(null, function(){d()},p=-1) | |
} | |
} | |
})([], -1, function(){}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment