Topics
Published on December 13, 2016 by DotNetFunda
Want create site? Find Free WordPress Themes and plugins.

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

Did you find apk for android? You can find new Free Android Games and apps.

Leave a Reply

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

Notify of
avatar

Bhuvana Tabatahalli
Guest
Bhuvana Tabatahalli
28 days 8 hours ago

GOOD One

Suyash Srivastava
Guest
Suyash Srivastava
5 months 6 days ago

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

Suyash Srivastava
Guest
Suyash Srivastava
5 months 6 days ago

Don't give wrong information

Satya Pratap
Guest
Satya Pratap
9 months 4 hours 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
9 months 1 hour ago

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

Ar Men
Guest
Ar Men
9 months 5 days 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
9 months 5 days 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