Unit 2 Exam Questions
Exam questions for Unit 2.
Exam questions for Unit 2.
Insem Exam Questions: Unit 2 Scope and Variable Management Q1. Define variable masking (shadowing) and explain its structural impact on execution scope. Variable masking occurs when a local variable declared inside a function shares the identical identifier as a global variable. The JavaScript engine resolves variables by searching from the innermost scope outward. The local variable intercepts the search. This impacts execution by rendering the global variable inaccessible from within that specific function block. The global variable remains structurally intact and its value is not overwritten, but the function’s logic operates exclusively on the local shadow variable. ...