A zero gets replaced

Take your time, follow the code and check your understanding.

The codeConditions
const count = 0;
const shown = count || 10; // should preserve zero
Your answer3 min · no timer
What needs fixing?

Show solution and explanation

|| replaces all falsy values. ?? preserves zero and falls back only for null or undefined.

Use ?? because zero is falsy.