this is actually my first post about javascript. Would like to know, the performance of the following code as it is a "Decrementing while loop" inside that while loop has an Incrementing variable.
var i = data.d.length;
var i_counter=0;
while (i--)
{
console.log(i_counter++)
}
My reason for adding i_counter++ is for sorting purposes. Would it slightly affect the loops performance for thousand of records? Would this code below much better than aboves performance?
for (var i = 0; i < data.d.length; i++) {
console.log(i)
}
I have seen an online loop stress test online and this shows that decrementing while is the best. Is it true? http://jsperf.com/fastest-array-loops-in-javascript/32 Please give me a fiddle to stress test the code. Thank you. Suggestions are well accepted.