Question 8
Back to Exercise
What happens when greet() is called on the line before const greet = () => "hi";?
- A It returns "hi"
- B ReferenceError – const greet is in its temporal dead zone Correct
- C It returns undefined
- D TypeError: greet is not a function
Correct Answer: Option B
An arrow is an expression; only the variable is hoisted. With var the call would be a TypeError (greet is undefined).
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!