Immediately-Invoked Function Expression (2010)

1 motorest 3 7/19/2025, 9:24:37 AM benalman.com ↗

Comments (3)

motorest · 1d ago
This blog post is referenced by Mozilla's page on IIFE.

https://developer.mozilla.org/en-US/docs/Glossary/IIFE

apothegm · 19h ago
Those infuriate me so much when I need a slight modification to the behavior of a third party library. Leaves no option but forking. There are such better ways to achieve encapsulation in modern JS.
motorest · 17h ago
> There are such better ways to achieve encapsulation in modern JS.

There aren't that many options even in modern JavaScript. You have ES6 modules, store state in a global map, what else?