Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js immediately invoked function

//IIFE
//Need to wrap function in ()
(function() {
	console.log("I will only run once");
})(); //Immediately calling it.

//Arrow Function
(() => console.log("Will only run once Arrow Function"))();
Source by flaviocopes.com #
 
PREVIOUS NEXT
Tagged: #js #immediately #invoked #function
ADD COMMENT
Topic
Name
9+1 =