DEV Community

Discussion on: How To Implement a Queue in JavaScript—and Beat Arrays at Their Own Game

Collapse
 
mattpopovich profile image
Matt Popovich • Edited

You're right! Firefox and Safari seem to handle unshifts much better than Chrome/Edge; they stay about even. I'll add a note about this.

Update: Added a note at the top about browser optimizations in Firefox & Safari, and a link to a great blog post on how SpiderMonkey optimized shift/unshift!