UNPKG

272 BJavaScriptView Raw
1"use strict";
2
3// https://code.google.com/p/v8/issues/detail?id=2560
4// v8 --harmony should print 0 1 2 (not 3 3 3) when executing:
5
6var arr = [];
7for (let x = 0; x < 3; x++) {
8 arr.push(function() {
9 console.log(x);
10 });
11}
12arr.forEach(function(f) { f(); });