Let\'s imagine we should get some data...
var data = [];
//some code omitted that might fill in the data (though might not)
Then we need t
I believe the second version is more idiomatic, not just in JavaScript, but in most programming languages. If you're that concerned about timing, you could save the length of the array in a variable, and use that variable in the loop, but I don't think that's necessary:
var data = [];
var length = data.length;
for (var i = 0; i < length; i++) {
//iterate over the data and do something to it
}