Do you know what will be the output of this code?
JavaScript
console.log(0 || "default");
Show answer and explanation
The answer is "default".
|| returns the first truthy operand, or the last operand if none are truthy. 0 is falsy, so it returns "default".
If 0 should count as a valid value, use ?? instead.