Hacker News new | ask | show | jobs
by firasd 1379 days ago
Oh my mistake. Still stuff like 'return a || b' is the kind of thing I see in JS way more than in PHP codebases
1 comments

Probably because the Boolean operators in JS return the left or right side of the expression, rather than a Boolean.

It was an okay-ish way to get a default/fallback value before JS got a proper coalescing operator.