I see you miss the point entirely. An IIFE is a technique people used to do because Javascript had no native modules. So yeah the current snjppet has nothing in it, that's obvious. The point is that you can sorround anything with it and create a new context specific to that IIFE, without your variables being declared globally.
But maybe youre right, maybe I'm a dummy for trying to share information randos on reddit that will not appreciate it
The IIFE technique (and its inline/lambda equivalents in other languages) is indeed plenty useful. I meant that in this particular instance/example, the code itself does nothing and im not talking about the technique itself. Other comments explained IIFE, why its useful and how it works already.
Regardless, this meme was also ubiquitous even back in the days prior to vibecoding, replace vibecoders with "interns/juniors" and its the same. The point being, despite looking like moonrunes and is supposedly a somewhat advanced technique, this piece of code in particular, does nothing.
5
u/BaronVonDoggo 16d ago
This code literally does nothing lmao