We all might have heard of "hoisting" while working in JavaScript. But not everyone knows in depth about it. In this post let's dive deep into it. var colour = "white"; console.log(colour); // white Here it's a simple block of code where the vari...
Variable shadowing: In JavaScript, variable shadowing occurs when a variable with the same name as a variable in a higher scope is declared in a lower scope, potentially causing confusion; let a = 10; if (true) { let a = 20; console.log(a); } ...