Y
Hacker News
new
|
ask
|
show
|
jobs
by
swannodette
5287 days ago
"everything you do is global, unless you know better"
That is not the JavaScript model at all.
1 comments
lnanek
5286 days ago
He is talking about if you don't do anything extra (in this case, use the var keyword). Much like the nonlocal keyword in Python requires knowing about it and wanting to use it in order to actually use it and get the non-default behavior.
link
swannodette
5286 days ago
var is not extra in JavaScript the way nonlocal is in Python. var is a language construct that any good JavaScript program
must
use.
link