self call function js code example Example: self calling function (function(){ console.log(Math.PI); })();