Self-Executing Functions

JavaScript – Instead of calling function .It is simple to invoke function automatically when page loads.

The syntax

(function helloword(){

alert(“Hello World”);

// write your functionality

})();