Learn Simpli

Free Online Tutorial For Programmers, Contains a Solution For Question in Programming. Quizzes and Practice / Company / Test interview Questions.

IIFE Immediately Invoked Function Expression

Introduction
  1. Is a JavaScript function that runs as soon as it is defined
  2. It is also called a Self – Executing Anonymous Function
  3. The first is the anonymous function with lexical scope enclosed within the Grouping Operator()
  4. This prevents accessing variables within the IIFE idiom as well as polluting the global scope
  5. The second part creates the immediately invoked function expression() through which the JavaScript engine will directly interpret the function