JS function calls Advanced --- array

An array of function calls

Arrays can store any type of data

Write function, the callback function in the array: function takes as an argument

    // array can store any type of data 

    var ARR = [
         function () { 
          the console.log ( "Happy Holidays eleven" ); 
        }, 
        function () { 
          the console.log ( "Happy Holidays eleven" ); 
        } 
        , 
        function () { 
          the console.log ( "health November holiday" ); 
        } 
        , 
        function () { 
          the console.log ( "security November holiday" ); 
        }, 
        function () { 
          the console.log ( "wishful November holiday" ) ; 
        } 
    ]; 
    //Callback function: the function as an argument 
    arr.forEach ( function (ELE) { 
      ELE (); 
    });

Guess you like

Origin www.cnblogs.com/jane-panyiyun/p/12164990.html