IIFE

IIFE

IIFE stands for "Immediately Invoked Function Expressions" which can also be referred to as "Self-invoking functions".

An IIFE is a normal function, the only difference is that it gets invoked or called immediately, and is usually used to contain a scope or to write asynchronous code that needs invoking right away.

To create an IIFE, a function is wrapped in parenthesis and then called just like any other function would be (function() { /* function body */ })();.

Related topics

© 2024 MWXYZ