ZSDirk Ecker Oh , I meant to say "invalid" instead of "valid." Yes, in your example you'd want to use ?? . I've updated the post and edited that section to be more clear; thanks for catching that!Reply·Article·Apr 10, 2022·When to use logical OR vs. nullish coalescing in JavaScript
ZS... when you want falsy left operands besides null and undefined to be considered valid. You should use || in this case.Reply·Article·Apr 10, 2022·When to use logical OR vs. nullish coalescing in JavaScript