Best way to implement a queue in javascript?
<p>Hi I want to use a queue in javascript.  So I guess I can do 1 of 3 things:</p>

<ol>
<li><p>javascript push, shift</p></li>
<li><p>array.push(), array[0], array.splice(0,1) etc.</p></li>
<li><p>Queue.js at <a href="http://code.stephenmorley.org/javascript/queues/#download" rel="nofollow">http://code.stephenmorley.org/javascript/queues/#download</a></p></li>
</ol>

<p>So I was reading the queue.js and was confused about the benchmarks because I don't really know what the numbers mean.  Also, I'm guessing there are better ways of doing a queue than the 3 I mentioned.  </p>

<p>So what's the best way of implementing a queue in javascript and why?  Also if anyone could explain the advantages and disadvantages among the 3 ways I described, that would be very helpful.  Thanks !</p>
