Closed Bug 1269863 Opened 8 years ago Closed 8 years ago

"const" in "for of" loop declaration throws SyntaxError

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1101653

People

(Reporter: callahad, Unassigned)

Details

(Keywords: DevAdvocacy)

`let` works as expected:

    » for (let x of ['foo', 'bar', 'baz']) { console.log(x); }
      foo
      bar
      baz
    « undefined

`const` unexpectedly throws:

    » for (const y of ['foo', 'bar', 'baz']) { console.log(y); }
    × SyntaxError: missing = in const declaration

Both work identically in Chrome.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.