- Local variables are defined with the
varkeyword. - Variables defined without
varare 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
undefinedvalues.