自调用匿名函数就是当程序运行时自动调用执行的函数,在JS中有三种创建的方式:
<script>
//create method one
(function(){
alert("hello world");
})();
//create method two
(function(){
alert("hello world");
}());
//create method three
!function(){
alert("hello world");
}();
自调用匿名函数就是当程序运行时自动调用执行的函数,在JS中有三种创建的方式:
<script>
//create method one
(function(){
alert("hello world");
})();
//create method two
(function(){
alert("hello world");
}());
//create method three
!function(){
alert("hello world");
}();