Is there a mechanism to loop x times in ES6 (ECMAScript 6) without mutable variables?
The typical way to loop x times in JavaScript is: for (var i = 0; i < x; i++) doStuff(i); But I don’t want to use the ++ operator or have any mutable variables at all. So is there a way, in ES6, to loop x times another way? I love Ruby’s mechanism: x.times do … Read more