Immediately invoked function expression
Javascript design pattern / From Wikipedia, the free encyclopedia
Dear Wikiwand AI, let's keep it short by simply answering these key questions:
Can you list the top facts and stats about Immediately invoked function expression?
Summarize this article for a 10 year old
SHOW ALL QUESTIONS
An immediately invoked function expression (or IIFE, pronounced "iffy", IPA /ˈɪf.i/) is a programming language idiom which produces a lexical scope using function scoping. It was popular in JavaScript[1] as a method to support modular programming before the introduction of more standardized solutions such as CommonJS and ES modules.[2]
Immediately invoked function expressions can be used to avoid variable hoisting from within blocks, protect against polluting the global environment and simultaneously allow public access to methods while retaining privacy for variables defined within the function.