After performing this test with most modern browsers...
Currently, the fastest form of loop (and in my opinion the most syntactically obvious).
a standard for loop with length caching
for (var i = 0, len = myArray.length; i < len; i++) {
}
I would say this is definitely a case where I applaud JavaScript engine developers. A run time should be optimized for clarity, not cleverness.
0 comments:
Post a Comment