← Back to demo
Easy Coding Real-life challenges Write a function

Product limit: zero is a setting

20 pts
An admin panel reads a product limit from an API. Return fallback only when value is null; the JS function should also handle undefined, which JSON fixtures cannot encode. Preserve 0. value is null or a non-negative integer; fallback is a non-negative integer. Choose an operator that does not confuse a missing value with zero.