Introduction to javascript special usage examples

  • 2020-03-30 00:39:42
  • OfStack

Grammar:
 
function sayWhat(msg){ 
alert(msg); 
} 
sayWhat(" hello "); 

Equivalent to the following syntax (js closure (anonymous self-executing function) syntax) :
 
(function(msg){ 
alert(msg); 
})(" hello "); 

Related articles: