1 /**
 2  * 防御型分号
 3  */
 4 ; (function () {
 5     //code....
 6     console.log('一开始,我自己执行了!!!');
 7 })();
 8 
 9 
10 
11 /**
12  * 形参 -> 实参
13  * 定义形参->接收实参->最后打印.
14  */
15 (function (a, b, c) {
16     console.log(a + b + c);
17 })(1, 2, 3)
18 
19 // (function(i){
20 //     console.log(i);
21 // })(window);
22 
23 
24 /**
25  * 声明了不需要返回函数(return)
26  */
27 void function () {
28     // code....
29     console.log('不需要返回return!');
30 }();

 

相关文章:

  • 2021-09-13
  • 2022-12-23
  • 2021-11-18
  • 2021-06-11
  • 2022-02-09
  • 2022-12-23
  • 2021-11-01
猜你喜欢
  • 2021-07-24
  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
  • 2021-10-29
  • 2022-12-23
相关资源
相似解决方案