What? The previous comment said it’s “downright impossible to learn” which is nonsense.
|| means “Evaluate and use the left operand, unless it’s falsy, in which case evaluate and use the right operand instead”
?? means “Evaluate and use the left operand, unless it’s nullish, in which case evaluate and use the right operand instead”
They’re the same thing except for which values fall through to the second operand
kryptonianCodeMonkey@lemmy.world 10 months ago
Have you tried divining syntaxes from reading the entrails of a sacrificed goat?
abbadon420@lemm.ee 10 months ago
It works on my machine