Create a Self-calling Function

this kind of function is mainly used to execute automatically when we create it.

(function(){
    // some private code that will be executed automatically
})();  
(function(a,b){
    var result = a+b;
    return result;
})(10,20)

Leave a comment

Your email address will not be published. Required fields are marked *