<分区>
Possible Duplicate:
Are “(function ( ) { } ) ( )” and “(function ( ) { } ( ) )” functionally equal in JavaScript?
我正在阅读下面的文档。
http://addyosmani.com/resources/essentialjsdesignpatterns/book/#patternity
当我查看这些示例时,匿名函数的自调用具有三种形式。
一个是
(function() {
//do something
})();
还有一个是
function() {
//do something
}();
另一个是
(function() {
//do something
}());
这三种形式有什么区别?
感谢您的阅读!