Course · Section 2: JavaScript Fundamentals – Part 1 · Lecture 11: Data Types
Implement `withDefault(value, fallback)` returning `value` unless it is null or undefined, in which case return `fallback`. Note that `0` and empty string are valid values.
+ 1 hidden test run on Submit.
?? treats only null and undefined as missing, so valid falsy values like 0 are preserved unlike with ||.
Run your code to see results.