Question 2
Back to Exercise
For function f(x = 10) { return x; }, which call returns 10?
- A f(null)
- B f(0)
- C f("")
- D f(undefined) Correct
Correct Answer: Option D
Defaults apply only when the argument is missing or undefined. null, 0 and "" are actual values and are returned as they are.
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!