TIL Immediately Invoked Function Expression
POSTED ON:
TAGS: javascript advanced
This is a design pattern where you create a function expression that is immediately executed.
(function () {
const jedi = "Qui-gon Jinn";
console.log(jedi);
})();
// immediately fires Qui-gon Jinn
// note: jedi is not referencable
REFERENCE:
https://developer.mozilla.org/en-US/docs/Glossary/IIFE
Related TILs
Tagged: javascript