Skip to content

Instantly share code, notes, and snippets.

@cferdinandi
Last active December 7, 2017 06:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cferdinandi/6337524 to your computer and use it in GitHub Desktop.
Save cferdinandi/6337524 to your computer and use it in GitHub Desktop.
An IIFE wrapper for JS functions...
;(function (window, document, undefined) {
'use strict';
// Code goes here...
})(window, document);
@reachtokish
Copy link

I have few questions on IIFE. Can you pls answer me of those ?

  1. Why we use IIFE in our javascript application?
  2. Actually there is two types of IIFE. One is wrapped up with parenthesis and one with not wrapped up. What is the meaning of both?
  3. what is the meaning of ';' -- this when we starting a IIFE ?

Please help me out with some example if you can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment