Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
pwdisswordfishy
10 months ago
|
parent
|
context
|
favorite
| on:
The Temporal Dead Zone, or why the TypeScript code...
I wish they had made lexical scope work like Lua, where the binding simply does not exist before the declaration – including in the initialization expression:
local x = 42 do print(x) -- 42 local x = x * 2 print(x) -- 84 end print(x) -- 42
Look, ma! No dead zones!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: