DEV Community

biplavmz
biplavmz

Posted on

What is Illegal Shadowing

It is a Situation where a variable in a inner Scope **(such as Block,Function) **unintentionally Hide a variable for the same name in an outerScope

Example 1 :->
`var x = 10;

function m1(){
console.log(x)
var x = 100;
console.log(x);
}

m1();`

Top comments (0)