- Local variables are defined with the
var
keyword. - Variables defined without
var
are automatically global.
- Two ways to define functions:
function someFunc(arg1, arg2) {}
var someFunc = function(arg1, arg2) {}
- All arguments are inherently optional. Calling someFunc() without arguments will NOT error out. The arguments will have
undefined
values.