Immediately Invoked

IIFE (Immediately Invoked Function Expression)



Anonymous and Invoked Immediately

Invoked immediately is also known as self executing

window.alert( ( function() { 
   return
} ) (1,2) ) ;


This will run everytime the file loads, notice the extra parentheses at the end.
Adding the "()" at the end will cause the function to be called / executed

( function myIIFE() { 
   //some code
} ) ();





© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext