[JavaScript] Immediately Invoked Function Expressions (IIFE)
const runOnce = function () {
console.log('This will never run again');
};
runOnce();
// IIFE
(function () {
console.log('This will never run again');
const isPrivate = 23;
})();
(() => console.log('This will ALSO never run again'))();
{
c...
jaydenjpark.hashnode.dev1 min read