Understanding JavaScript Blocks and Scope
Block 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 ...