DEV Community

biplavmz
biplavmz

Posted on

1

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)

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay