Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
A default parameter applies when its argument is missing or undefined, not when it is null.
For function greet(name = "Guest") { return name; }, greet() and greet(undefined) return "Guest". greet(null) returns null, and greet("") returns the empty string. Default expressions are evaluated when the function is called and the default is needed, not once when the function is defined.