Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
nullz
on June 1, 2015
|
parent
|
context
|
favorite
| on:
How necessary are var, let, and const?
It doesn't in v8 -- what do you mean by `should`?
egeozcan
on June 1, 2015
[–]
It's an implementation error. In Firefox, it correctly throws:
> ReferenceError: can't access lexical declaration `a' before initialization
titzer
on June 2, 2015
|
parent
[–]
No, legacy const is not spec'd by ES5. It behaves differently in FireFox and V8 because it was added at different times with different semantics in the live range hole case. In strict mode, it will throw on V8 as well.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: