【发布时间】:2011-09-18 04:04:43
【问题描述】:
可能的重复:
JavaScript: Why the anonymous function wrapper?
A Javascript function
How does the (function() {})() construct work and why do people use it?
我在 javascript 中看到了以下格式的一些代码:
(
function()
{
//stmt
}
)();
为什么我们要使用这些独立的括号?谢谢。
【问题讨论】:
标签: javascript