Anyway... that wouldn't really change the way I would write for's, they are for's and there isn't any compelling reason to write differently I used to.
I actually did read about what you said in past. And the conclusion is about the same it doesn't really makes sense to change the way you code because of it
@BrunoCosta You wrote an answer talking about performance. I outperformed you. On Internet Explorer! That says something about the superiority of my for loop.
@IsmaelMiguel Got your point. But getting from O(n^2) to O(n) is what matters most and something that you have to think and take your time and engineer. While writing code differently because of performance is different, of course it's important to do that, however you should only look at that if it becomes a bottleneck
@IsmaelMiguel I don't believe it is. Also I tested the other example you gave me and couldn't come to a conclusion after all. All I saw was different values in the console
@Malachi it wasn't the case actually just wondering if you were here to support me (6)
@IsmaelMiguel I hope you can now understand why you can't just execute the code for just once in a envorment each time. Even if it gives you good results every single time it doesn't really matter if in the long run (as the code is running and being optimizied to the cpu with cache system and branch prediction and instuction optimization etc...) it all comes to almost the same
in order to show if something is a bottleneck or not you can't make tests in a new enviornment everytime
I don't know what is going on, I am trying to get some distance from chat at the moment so I can implement google API for Zip code to City, State on a form.
that's my point you can't make performance tests that way. It's true that we would also need to have the exactly same enviornment. But jsperf is a place were you can accomplish the best possible numbers software wise
well maybe not the best but I'm pretty sure they were pretty serious about it!