Topics
Published on December 13, 2016 by DotNetFunda

In this video we will try to understand why we need JavaScript IIFE ( Immediately invoked function expression).

See our other Step by Step video series below.
Learn MVC 5 Step by Step in 16 hours:- goo.gl/dmdakg
Learn MVC Core (MVC 6) Step by Step :- tinyurl.com/hxer5xs
Learn AngularJS 1.x Step by Step in 8 hours :- goo.gl/F3ovSr
Learn Angular 2.0 Step by Step in 8 hours:- tinyurl.com/z3vnvhg
Learn Design Pattern Step by Step in 8 hours:- goo.gl/eJdn0m
Learn C# Step by Step in 100 hours :- goo.gl/FNlqn3
Learn SQL Server Step by Step in 16 hours:- tinyurl.com/ja4zmwu
Learn Javascript in 2 hours :- tinyurl.com/zkljbdl
Learn MSBI Step by Step in 32 hours:- goo.gl/TTpFZN
Learn SharePoint Step by Step in 8 hours:- goo.gl/XQKHeP
Learn TypeScript in 45 Minutes :- goo.gl/oRkawI

Leave a Reply

14 Comments on "Step by step understanding JavaScript IIFE ( Immediately invoked function expression)"

Notify of
avatar

sateesh b
Guest
sateesh b
3 months 5 days ago

HI Shiv,It was very nice video on IIFE… I have went through link which is shared at the end of this video.. tinyurl.com/jnhdmmj It was superb… but it has only 30min video. I would be more helpful if the next 30min link also shared. Please share the next 30min link on oop javascript.Thanks In AdvanceThanks

sateesh b
Guest
sateesh b
3 months 5 days ago

HI Shiv,It was very nice video on IIFE… I have went through link which is shared at the end of this video.. tinyurl.com/jnhdmmj It was superb… but it has only 30min video. I would be more helpful if the next 30min link also shared. Please share the next 30min link on oop javascript.Thanks In AdvanceThanks

Bhuvana Tabatahalli
Guest
Bhuvana Tabatahalli
4 months 28 days ago

GOOD One

Bhuvana Tabatahalli
Guest
Bhuvana Tabatahalli
4 months 28 days ago

GOOD One

Suyash Srivastava
Guest
Suyash Srivastava
9 months 6 days ago

It is not an exception it is caused by function hoisting if you know

Suyash Srivastava
Guest
Suyash Srivastava
9 months 6 days ago

Don't give wrong information

Satya Pratap
Guest
Satya Pratap
1 year 1 month ago

Hi Shiv, So can't we use anymore iffy variables as a global variables …? since we are unable to access the global variable (I.e. counter) inside of the function, then any ways to access a variable inside of the iffy block..? thanksSatya

.NET Interview Preparation videos
Guest
.NET Interview Preparation videos
1 year 30 days ago

Hello Satya sir,The variables created inside IIFY will not be public he can still access public variables.

Satya Pratap
Guest
Satya Pratap
1 year 1 month ago

Hi Shiv, So can't we use anymore iffy variables as a global variables …? since we are unable to access the global variable (I.e. counter) inside of the function, then any ways to access a variable inside of the iffy block..? thanksSatya

.NET Interview Preparation videos
Guest
.NET Interview Preparation videos
1 year 30 days ago

Hello Satya sir,The variables created inside IIFY will not be public he can still access public variables.

Ar Men
Guest
Ar Men
1 year 1 month ago

Instead of this complicated code we can just rename top "counter" variable to topCounter for example. It will be much simplier then IIFE.

QuestPond
Guest
QuestPond
1 year 1 month ago

In projects of huge magnitude the components ( functions) are created by some on else and page by some one else. You never know with lot of global variables you are sitting on a ticking bomb.

Ar Men
Guest
Ar Men
1 year 1 month ago

Instead of this complicated code we can just rename top "counter" variable to topCounter for example. It will be much simplier then IIFE.

QuestPond
Guest
QuestPond
1 year 1 month ago

In projects of huge magnitude the components ( functions) are created by some on else and page by some one else. You never know with lot of global variables you are sitting on a ticking bomb.

wpDiscuz