Question 10
Back to Exercise
The code below stops with an uncaught error. Which statement correctly describes the problem?
const isMember = true;
if (isMember) {
console.log("Discount:", discount);
let discount = 10;
}
- A ReferenceError: discount is used in its temporal dead zone, before let discount runs Correct
- B It prints Discount: undefined
- C It prints Discount: 10
- D SyntaxError
Correct Answer: Option A
let is hoisted to the top of the block but not initialised until its line. Move the declaration above the console.log.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!