Tuesday, February 18, 2014

function definition
JS creates functions by assigning variables to them, instead of defining new commands like Python
function syntax
var name=function(param){what the function does;};
parameters
stuff in parentheses when function is defined
arguments
stuff in parentheses when function is called
call
to execute the commands in a function
D.R.Y.
don't repeat yourself
return
saves but does not print the result of the function
scope
global or local
global
defined outside a function
local
defined inside a function and only applicable in that particular function
var
used to define the scope of a variable, can be used even on variables of the same name to leave a global variable unchanged

1 comment:

  1. Excellent! You were the only one who paid attention when I mentioned "arguments" in class.

    ReplyDelete