So, I have seen this piece of code at alot of places:
for (var i = 0, len = myArray.length; i < len; i++) {
}
I am aware that is the length caching of the array.
Today I saw this:
var len = myArray.length; var i = 0; while(i++ < len)
Efficiency wise, both would be the same, right? Any input would be appreciated.