Hacker News new | ask | show | jobs
by ufo 4493 days ago
I actually like using the ternary operator in this sort of assignment, so I only need to type the variable name once instead of 3 times. The only real problem in your example is that everything is in one line. It woulf be better to indent that and to add some extra parenthesis to make the precedence clearer.