Question 8
Back to Exercise
Which conversion works when the value may be null?
- A value.toString()
- B String(value) Correct
- C value.valueOf()
- D value + toString
Correct Answer: Option B
String(null) is "null". null and undefined have no methods, so null.toString() throws a TypeError.
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!