Hacker News new | ask | show | jobs
by kalefranz 2940 days ago
Alternately, `x and y or z`
1 comments

That's a historic method that was popular before the ternary operator was added, but I'd recommend against it. Primarily because it's just less readable and obvious what the intent is, but also because if `y` is say `[]`, it won't work because that evaluates to `false`.