re: What is an IIFE? VIEW POST

re: There are useful use for IIFE in modern apps. For instance when you need an expression and don't want to define a separate function (e.g for clarit...

Thanks, I have not done much in the world of React, outside of my own curiosity. I have seen and used IIFE's pretty regularly in some older angularJs apps. Used mostly for the ability to work on some logic without affecting the global window of properties. I'll have to take a look at React's do-expression.


React is just one example where IIFE can be useful though the use case I was referring to applies anywhere where you need/want an expression and need to perform some logic.
do-expressions is a new js feature but isn't limited to react either.

Gotcha, re-read what you stated, makes sense when thinking about something like a ternary operation not quite fitting the bill.

code of conduct - report abuse