Are loops really faster in reverse?
It’s not that i– is faster than i++. Actually, they’re both equally fast. What takes time in ascending loops is evaluating, for each i, the size of your array. In this loop: for(var i = array.length; i–;) You evaluate .length only once, when you declare i, whereas for this loop for(var i = 1; i … Read more