Scope Chain & Lexical environment
In this article, we will see scope, scope chain and lexical environment.
Let us first see a script and try to guess its output
function a(){
c()
function c(){
console.log(b)
}
}
var b=5;
a();
//output:5
In the above program, the javascript engine wi...
aakankshadhurandhar.hashnode.dev3 min read
Saurabh Mhatre
Frontend Developer
Good article with detailed examples and diagrams for explaining concepts. Keep it up 👍