re: What in the IF is a ternary? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I agree with @tux0r on this one. Ternary statements are awesome for showing off fancy JS skills, but in practicality, they're very hard on the ey...
 

Since ternaries push you to use expressions, it makes your code less about control flow (if this, do that, else do something else) and more about "given this and that, send this value back".

It's very easy to write a lot of code in the if/else that should have been written as a set of functions acting one after the other to transform the data.

Of course if you've got small functions and aren't doing much within your if/else, it'll help long term maintainability.

code of conduct - report abuse