📜  javascript IIFE - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:10.428000             🧑  作者: Mango

代码示例3
//IIFE, aka, 'Immediately Invoked Function Expression'
//The syntax for defining an IIFE can be seen in the following example:

(function(a,b){         
     return a + b; 
})(10,20);

//You can also use an arrow function in defining an IIFE:
(() => {     
    //... 
})();