for-of in Firefox

Axel Rauschmayer axel at rauschma.de
Sat Jul 26 10:11:02 PDT 2014


Does Firefox not yet do the one binding per loop iteration? I would have expected the output `0` in the following code.

```js
let arr = [];
for (let i of [0, 1, 2]) {
    arr.push(() => i);
}
console.log(arr[0]()); // 2
```

-- 
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140726/cbafad11/attachment-0001.html>


More information about the es-discuss mailing list