DEV Community

loading...

Discussion on: Explain IIFE(Immediately Invoke Function Expression) Like I'm Five

Collapse
cookrdan profile image
Dan • Edited

IIFE:
Plate goes on the table and a fork full of food immediately goes into your mouth.

Normal Function:
Plate goes on the table and you must wait until Mom tells you to each fork full.


IIFEs are functions that are run immediately without the need to be called from somewhere else.

Normal functions need to be called before they are run.

Collapse
latheresienne profile image
Latheresienne Author

Nice approach with food 😋. Thanks for thé explanation.

Collapse
cookrdan profile image
Dan

You’re welcome