A Javascript function

人盡茶涼 提交于 2019-12-28 04:27:07

问题


Please explain the following way of writing a function in javascript functions :

(function (){
 // some code 
})()

I understand the fact that because of the trailing braces " () ", the function will execute immediately but but what does enclosing the function in the braces mean?

来源:https://stackoverflow.com/questions/6340874/a-javascript-function

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!