First understand scope; said old closure
let age = 10;
console.log(age); // logs 10
Scope manages the accessibility of variables. Since the definition of age (line # 1) & accessing it (line # 2) are within the same scope. It works!
In JavaScript, a new scope is created by a function or a ...
naumanzafar.dev2 min read