Y
Hacker News
new
|
ask
|
show
|
jobs
by
bpicolo
3154 days ago
Why is the `var` keyword required in function arguments if it's dynamically typed and there's no other possible option?
2 comments
billytetrud
3154 days ago
So you don't create variables when you typo a variable name. Declarations are an error catching mechanism
link
fasquoika
3154 days ago
This is a complete guess, but maybe so they can treat it the same way as normal variable declarations
link
ateesdalejr
3154 days ago
Might be. Probably reusing the same pattern matching code in function definitions.
link