Let Binding in For Loop with setTimeout

RESOLVED DUPLICATE of bug 854037

Status

()

Core
JavaScript Engine
RESOLVED DUPLICATE of bug 854037
3 years ago
3 years ago

People

(Reporter: jacobparker1992, Unassigned)

Tracking

37 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: DUPEME)

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0
Build ID: 20150403141925

Steps to reproduce:

for (let i=1; i<=5; i++) {
    setTimeout(function(){
        console.log("i:", i);
    }, 0);
}


Actual results:

5
5
5
5
5


Expected results:

1
2
3
4
5

Updated

3 years ago
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Already fixed in Firefox 39, Aurora/Dev Edition currently.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 854037
You need to log in before you can comment on or make changes to this bug.