closure_js

 a closure is a function that references variables in the outer scope from its inner scopeThe closure preserves the outer scope inside its inner scope.

function A(a){
   function B(b){
        console.log (a+b);
    }
    return  B;
}
C=A(10);
C(40);
//console.log(C(20));

Comments

Popular posts from this blog

interview questions js[ Anurag Singh ProCodrr]

reactnative_creation