Bhavesh Jadhavbhaveshjadhav.hashnode.dev·May 28, 2024Understanding JavaScript Blocks and ScopeBlock in JavaScript A block, or compound statement, in JavaScript is defined by the curly braces {}. It is used to group multiple statements together. For example: { let a = 10; console.log(a); } Why Do We Need to Group Statements? We group ...Discuss·11 likes·41 reads2Articles1Week
Abhishek Dandriyalabhishek-dandriyal.hashnode.dev·Apr 8, 2024Javascript Scope: Var, Let and ConstVariable 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); } ...Discuss·1 likeIllegal shadowing