Learn Angular in 10 days – Day 4 – Part 2

Marla Sukesh. Code Project. 2017-09-19.

A 10 Days series on Latest version of Angular – Day 1 will be very basic and mostly on JavaScript, TypeScript.

[Learn Angular in 10 days – Day 4 – Part 2]

Advertisements

JavaScript IIFE (Immediately Invokable Function Expressions in JavaScript) Design Pattern

Mayank Gupta. CodeProject. 2017-06-15.
This post gives a small introduction about Singleton Pattern in JavaScript.
The post offer you more topics on Object Oriented JavaScript Design.
IIFE (Immediately Invokable Function Expression) is a important concept in JavaScript. it is a commonly used Design Pattern which is used to wrap set of variables and functions which cannot be accessed outside the enclosed scope.
These are Anonymous Function that is wrapped inside a set of paranthesis and is called immediately.
The common advantage of IIFE is that any “Function or Variable” defined inside IIFE, cannot be accessed outside the IIFE block, thus preventing global scope from getting polluted. Also helps us manage memory in an efficient manner.
In order to understand the concept of IIFE, we need to understand the difference between the following:
Function Definition
Function Expression

[JavaScript IIFE (Immediately Invokable Function Expressions in JavaScript) Design Pattern]