//self-invocation of anonymous functions/*var f1 = function () {Console.log (' I am an anonymous function! ');}*///F1 ();//above is the definition of an anonymous function, and then called, in fact, the variable name above, and then use () to invoke//This will be an error, because the function body of the curly braces are separated, can not explain the use of small expansion number to adjust the priority/*function F2 () {Console.log (' is I am an anonymous function and is self-invoking! ‘);} ();*/(functionf3 (name) {Console.log (' Yes I am an anonymous function, and it is self-invocation! ' +name);}) (' Sentiger '); //the benefit of using anonymous function self-invocation: Prevent the function from being polluted, the file is large, it is likely to have duplicate names, and may affect each other when introducing a third-party plug-in. Like some jquery frameworks are self-invoking using anonymous functions to prevent contamination
JavaScript anonymous function self-invocation