js自调用匿名函数的三种写法(推荐)

内容摘要
第一种:


(function(){
console.log(‘hello world”)
})()


第二种:


(function(){
console.log(‘hello world')
}())


第三种:


!function(){
consol
文章正文

第一种:

(function(){ 
   console.log(‘hello world”) 
})() 

第二种:

(function(){ 
   console.log(‘hello world') 
}()) 

 第三种:

!function(){ 
   console.log(‘hello world') 
}() 

以上这篇js自调用匿名函数的三种写法(推荐)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持phpstudy。


代码注释

作者:喵哥笔记

IDC笔记

学的不仅是技术,更是梦想!