1. What's the output of console.log(x); var x = 5; and why?


Core Concept: Hoisting with var.

Standard Answer: The output will be undefined. This is because of hoisting, a JavaScript mechanism where variable declarations using var are moved to the top of their scope before code execution. So, the code is interpreted as if it were written like...