Q1
What is the difference between 'let' and 'var' in JavaScript?
mediumCorrect Answer: 'let' is block-scoped, while 'var' is function-scoped
Explanation:
A variable declared with 'let' inside a block, such as an if statement or loop, is only accessible within that block, while 'var' ignores block boundaries and is instead scoped to the nearest enclosing function.