Total WebSite Views Count

JavaScript Closures

JavaScript Closures

A closure is an inner function that has access to the outer (enclosing) function’s variables — scope chain.

The closure has three scope chains: it has access to its own scope (variables defined between its curly brackets), it has access to the outer function’s variables, and it has access to the global variables.
Let see a closure example below:
function User(name)
{ var displayName = function(greeting){ console.log(greeting+' '+name); } return displayName; } ​ var myFunc = User('Architect');
//Call Closure myFunc('Welcome '); //Output: Welcome Architect myFunc('Hello '); //output: Hello Architect
In this code, We have an outer function User() which returns an inner function as displayName(),
The inner function will have access to the variables in the outer function scope, even after the outer function has returned.

AWS Services

AWS Services

Technology Selection & Evaluation Criteria

Technology Selection & Evaluation Criteria

Scale Cube - Scale In X Y Z Cube

Scale Cube - Scale In X Y Z Cube

Feature Post

AWS Services

About Me

About Me

Spring Cloud

Spring Cloud
Spring Cloud

Spring Cloud +mCloud Native + Big Data Archittect

Spring Cloud +mCloud Native + Big Data Archittect

ACID Transaction

ACID Transaction

Data Pipe Line Stack

Data Pipe Line Stack

Popular Posts