It may be worth noting that in es6, the let keyword in for-loop was designed to solve the notorious closure problem in a loop in JavaScript:
var log = msg => div.innerHTML += msg + "<br>"; for (var i=0; i < 3; i++) { Promise.resolve().then(() => log(i));
<div id="div"></div>
As @loganfsmyth mentions in the comments, he does this by effectively creating a new closure for each iteration of the loop.
This and the fact that this feature is new may explain some of the performance differences observed in Chrome. However, in your specific example, there seems to be no difference in Firefox, so browsers can optimize this.
source share