12-2- function expression

<! DOCTYPE HTML > 
< HTML lang = "EN" > 
< head > 
    < Meta charset = "UTF-. 8" > 
    < title > the Title </ title > 
</ head > 
< body > 
< Script > 

    // this way defined functions can not be executed directly behind bracketed 
    // only brackets executed by name 
    // function a () { 
    //      Alert () 
    // } (); 

    // function defined in this way, directly behind the brackets execute 
    // the let A = function () { 
    //     Alert (. 1); 
    // } (); 

    // anonymous function code can not be directly placed, it can be directly put in [] 
    // function () {} 

    // This is a self-executing the function, not the closure 
    // the anonymous function within parentheses, may exist, can be directly executed 
    // this function in the presence of significance will only be called once, there is no need to keep 
    // both are possible 
    // (function () {Alert (. 4)}) (); 
    // (function () {Alert (. 4) ()}); 

    // both are possible 
    // + function () { 
    //      Alert (. 1); 
    // } (); 

    // - function () { 
    //      Alert (2); 
    // } (); 

    // ~ function () { 
    //      Alert (. 3); 
    // } ();

    // function () {! 
    //      Alert (. 4); 
    // } (); 

    // ! () This use of more + - ~ return value will change 
</ Script > 
</ body > 
</ HTML >

 

Guess you like

Origin www.cnblogs.com/zhangyu666/p/11479660.html