Immediately-invoked function expression (IIFE)

The Immediately-Invoked Function Expression or IIFE for short is pretty self explanatory: it executes immediately after it's created.
It is not related to any event handler such as document.ready.
The first part (function(){...}) turns the code within into an function, and the parentheses at the end (); calls that function. IIFE has all the characteristics of any other functions regarding scopes.

(function(){ // do something })();

Result Box
  • html
  • css
  • js

Share This:

Feel free to leave a comment!

You might alos be interested in:

45 Replies to “Immediately-invoked function expression (IIFE)”

  1. Pingback: canadian drug
  2. Pingback: canada rx
  3. Pingback: canadian pharmacys
  4. Pingback: online pharmacy
  5. Pingback:
  6. Pingback: buy viagra germany
  7. Pingback: buy stromectol uk

Comments are closed.