What is Illegal Shadowing
biplavmz
Posted on April 30, 2024
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();`
đź’– đź’Ş đź™… đźš©
biplavmz
Posted on April 30, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
javascript Say Goodbye to Unnecessary Re-Renders with React Memo: Step-by-Step Tutorial
November 11, 2024