【发布时间】:2011-10-10 15:43:15
【问题描述】:
可能的重复:
What does this JavaScript snippet mean?
Location of parenthesis for auto-executing anonymous JavaScript functions?
(function(){
//something here...
})() <--//This part right here.
这个)()到底是什么?
如果我把它改成这个())呢?
(function(){
//something here...
}()) <--//Like this
【问题讨论】:
-
我认为这没有任何作用。不过我可能是错的。
-
同样的问题,see my answer
-
非常常见的问题。
-
您的两个示例之间只有“语法”差异,请查看this answer。
标签: javascript function