🔰IIFE
Immediately-Invoked Function Expression
JS ⟩ concepts ⟩ expression ⟩ function expression ⟩ IIFE
immediately-invoked function expression
// ⭐️ IIFE
(function(){
// ...
})();
// ⭐️ more compact form
!function(){
// ...
}();
// ⭐️ arrow function as IIFE
(() => {
// ...
})();arrow function can be used as IIFE.
IIFE is a function expression.
Node.js automatically wraps the code of a JS file in a self IIFE.
module pattern was implemented using IIFE.
Last updated
Was this helpful?