First, the definition:
1. function declaration functions func () {}
2. Function Expression var func = function () {}
Note the point:
var function // OK// error, test isn ' t defined
The difference between an anonymous function expression and a named function expression
(1) Named function expressions
function// test
(2) An anonymous function expression
var test function// func// test
Second, return effect
1. Returns the result value of a series of functions processed by a function
2. Termination of function operation
The number of arguments passed and the number of parameters set can be more, less, not wrong
Why? Because the form context of a function (an object) has a name of the arguments property, and its value is an array of classes, which stores all the arguments passed in, so that when the function is called, the arguments are directly stored in the class array as the attribute name as the parameter name as the property names. Instead of worrying about whether the number of arguments is the same as the number of parameter sets
The number of parameters can be viewed through the funcname.length by arguments.length
Iv. Scope
1.
------------------------------
The function of JS