Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Self Invoking Function ($()) That Can Be Reused

 		  $ = (function () {
			  console.log("first");
			  
			  $ = function (){
				  console.log("second");
			  }	  
	return $
		  })()
          /*$() will execute console.log("second") after the first time*/
 
PREVIOUS NEXT
Tagged: #Self #Invoking #Function #That #Can #Be #Reused
ADD COMMENT
Topic
Name
3+2 =