file.js:
(function(m) {
//some
//code
//here
}(m))
我无法得到这种结构意味着什么?
答案 0 :(得分:3)
该代码定义了一个内联函数,并立即执行它。
通过将函数替换为变量来考虑它:
(function(m) {
//some
//code
//here
}(m))
那就是:
var f = function(m) {
//some
//code
//here
}
(f(x))
但无需定义f
。