// 使用 ! 、+ 、- 等运算符 ;!function(win){ console.log(win); }(window); // 使用括号,推荐这种写法,因为没有返回值参与运算 (function(win){ console.log(win); })(window); // 或 (function(win){ console.log(win); }(window));