JavaScript Interview Questions | Immediately Invoked Function Expression (IIFE)



Immediately-Invoked Function Expressions (IIFE), pronounced “iffy”, are a common JavaScript pattern that executes a function instantly after it’s defined. Developers primarily use this pattern to ensure variables are only accessible within the scope of the defined function.