我已经开始使用 JSLint。我检查了我的代码,但出现了以下错误:
Problem at line 92 character 7: Move the invocation into the parens that contain the function.
})();
Problem at line 92 character 7: Wrap the entire immediate function invocation in parens.
})();
如何解决这个错误?
最佳答案
我相信这意味着您应该将函数调用括号移到包装括号内
(function() { /* code */ })()
执行函数的最后两个括号是问题所在。这是 jslint 希望它看起来像的样子:
(function() { /* code */ }())
关于javascript - JSLint错误的解决方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1450721/