Learn from peers
Discuss and share learning resources with the top professionals across the world
Open business or job opportunities
Earn reputation points to get consulting projects, attract talent or land jobs.
Accelerate your growth
Grow your network and get exclusive deals from our learning partners.
signup now
Ex.
function add (a) {
return function (b) {
return a + b;
}
}
let addFive = add(5),
addSeven = add(7);
console.log(addFive(10)); //15
console.log(addSeven(9)); //16
So here in addFive(10) , the variable a of parent function is alive because it returns a function that uses a.