What is Immediately-Invoked Function Expression (IIFE) ?
An IIFE or Immediately Invoked Function Expression is a function that is gonna get invoked or executed after its creation or declaration. The syntax for creating IIFE is that we wrap the function (){} inside a parentheses () or the Grouping Operator to treat the function as an expression and after that we invoke it with another parentheses (). So an IIFE looks like this
An Immediately-Invoked Function Expression can be used to “lock in” values and effectively save state.