News Score: Score the News, Sort the News, Rewrite the Headlines

Array.shift optimizations in Firefox's JS Engine

When working with arrays in Javascript, there's two sets of functions if you want to add or remove items to an array to a certain end of the array. shift / unshift: remove / add items at the front of the array. pop / push: remove / add items at the end of an array. I had a scenario where using shift acted differently than I expected and lead to some interesting results. How Array.shift works By definition on MDN: The shift method removes the element at the zeroeth index and shifts the values at ...

Read more at lannonbr.com

© News Score  score the news, sort the news, rewrite the headlines