Analyze the following code:
let x = 10; function test() { let x = 20; console.log(x); }
What will be displayed in the console as a result of its execution?
20
- Nothing will show up.
x
10
Explanation & Hint:
Since the test function is never called in the code, the function is not executed, and therefore, nothing is printed to the console. |