- JS creates functions by assigning variables to them, instead of defining new commands like Python
var name=function(param){what the function does;};
- stuff in parentheses when function is defined
- stuff in parentheses when function is called
- to execute the commands in a function
- don't repeat yourself
- saves but does not print the result of the function
- global or local
- defined outside a function
- defined inside a function and only applicable in that particular function
- used to define the scope of a variable, can be used even on variables of the same name to leave a global variable unchanged
Tuesday, February 18, 2014
Subscribe to:
Post Comments (Atom)
Excellent! You were the only one who paid attention when I mentioned "arguments" in class.
ReplyDelete