function - ✔ ✔ What is a named set of statements that performs a task or
calculates a value?
function myFunction(){} - ✔ ✔ How do you declare a function?
calling statement - ✔ ✔ What processes a function's statements?
nothing - ✔ ✔ What happens if you define a function but do not call it?
myFunction() - ✔ ✔ How do you call this function?
function myFunction(){
return "success";
}
return - ✔ ✔ What is used to output values from a function?
local variable - ✔ ✔ What type of variable is declared within a function and
available only from within that function?
, global variable - ✔ ✔ What type of variable is available throughout the
entire script?
argument - ✔ ✔ What is a value or expression containing data or code that is
passed on to a function?
pass by reference - ✔ ✔ What describes when values are passed to a
function, and the function's parameters receive a copy of its argument's value?
Example:
function myFunction(x){
return x;
}
var num = 2;
myFunction(num);
pass by value - ✔ ✔ What describes when values are passed to a function,
and the function's parameters receive its argument's actual value?