Question 1
Back to Exercise
Which comparison does a switch statement use to match a case?
- A Loose equality (==)
- B Object.is()
- C Less-than-or-equal (<=)
- D Strict equality (===) Correct
Correct Answer: Option D
switch uses ===, so case 2 does not match the string "2", and no type conversion happens.
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!