A Javascript function

2019-01-12 08:03发布

问题:

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?