for-of in Firefox
# Rick Waldron (11 years ago)
The implementation predates ES6 let: bugzilla.mozilla.org/show_bug.cgi?id=950547
The implementation predates ES6 let: https://bugzilla.mozilla.org/show_bug.cgi?id=950547 Rick On Sat, Jul 26, 2014 at 1:11 PM, Axel Rauschmayer <axel at rauschma.de> wrote: > 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 > > > > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140726/61f33028/attachment.html>
Does Firefox not yet do the one binding per loop iteration? I would have expected the output
0
in the following code.let arr = []; for (let i of [0, 1, 2]) { arr.push(() => i); } console.log(arr[0]()); // 2