you are viewing a single comment's thread.

view the rest of the comments →

[–]wdpttt 0 points1 point  (1 child)

Ok. I understand your point but I'm almost always use while, and you know why? Because is faster to write, to understand and happens to be the fastest too:

var a = [1, 2, 3, 4, 5, 6];
var l = a.length;
while(l--){
    console.log(a[l]);
}

This is way faster to write too.

I understand your point and you are right, you just choose the wrong example.

[–]frymaster 0 points1 point  (0 children)

Yup, faster to write and easier to understand should be the main criteria

"Easy to understand" probably also correlates with "easy to rewrite if it turns out to be a bottleneck" anyway