JavaScript

IIFE

Definition

Immediately Invoked Function Expression — a function that runs immediately after being defined. IIFEs create a private scope and are used to avoid polluting the global namespace.

Code Example

Javascript
Tip: Modify the code above and click “Run” to see the results

Learn More

Related Terms