Hacker News new | ask | show | jobs
by dlbucci 1564 days ago
Especially if you format them well. Just use a newline before each `:` and maybe after each `?` (if the value expressions are large), and it'll look great.

  return isA ? A
    : isB ? B
    : isC ? C
    : D
1 comments

This looks fine as an example right here, but it starts to look terrible if there's larger or multiline boolean expressions involved, while if/else if winds up still being pretty readable.