1 回答
已采纳

西兰花伟大炮
TA贡献376条经验 获得超318个赞
(function demaxiya(x) { console.log(x + 5); })(10); //15
用两个括号包起来,一个传函数体,一个传参数,不需要再对函数进行额外调用,经常用来形成类似命名空间,防止全局变量命名冲突,当然还有其他的一些书写形式
添加回答
举报
0/150
提交
取消