Advanced JS Concepts
Lexical Scoping and Closure
Consider the code:
function a()
{
let c=10
return function b(){
console.log(c)
}
}
const func=a()
func() // 10
a() creates a local variable called c and a function called b(). The b() function is an in...
kossblogs.hashnode.dev14 min read