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...
·3 min read·aakankshadhurandhar.hashnode.devRead the article
Saurabh Mhatre
Good article with detailed examples and diagrams for explaining concepts. Keep it up 👍