Queue Feature Request

Zach Boldyga zach at scalabull.com
Sat Feb 25 23:03:34 UTC 2017

   Sorry if this is an ignorant request, I scanned the proposals and didn't
see anything that appeared similar.

   Is it appropriate for ECMAScript to include a Queue implementation, or
adjust shifting to a constant amortized time operation? Server-side usage
of the language is mostly formidable nowadays, and I've run into cases
where it would have been convenient to have an in-language queue.

   I see in the latest Array.prototype.shift documentation (
https://tc39.github.io/ecma262/#sec-array.prototype.shift) that shift is
still intended to be an O(n) operation, meaning those wanting to implement
a proper queue may need to rely on external libraries, like this one:
https://github.com/petkaantonov/deque .

   As the github link mentions, V8 has a trick to get around array
resizing, but for serious users we still need to rely on an external
library. It'd be great if this was a built-in feature.

   I'm sure someone has looked at this before - what do you think?


Zach Boldyga
Scalabull  |  Founder
1 (866) 846-8771 x 101
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170225/1649a045/attachment.html>

More information about the es-discuss mailing list