|
|
|
|
|
by IgorPartola
5387 days ago
|
|
Exactly. For example in JavaScript doing a something.length would result in re-counting the number of elements, while doing the loop in this style would efficiently store the count in a variable that is fast to access and manipulate. I suppose if you want to be a real optimization junky you'd also use --i instead of i--. |
|
Ten years ago, sure, but nowadays I trust the compiler to do this for me ;-)