If you hate the ternary conditional operator in the first place, there is no need to answer;)
Usually I see that this is used in tandem with an assignment expression, for example:
var foo = (some_condition) ? then_code : else_code;
However, I would like to use it to replace simple code:
if(some_condition) {
do_something_simple;
} else {
do_something_else;
}
and instead:
(some_condition) ? do_something_simple : do_something_else;
I will probably do this in JavaScript. In the above example, it returns undefined, so it does not require an assignment. I like the space saved, but be surprised that people think about this type of use, because, again, I usually only see the triple used for the purpose.
EDIT: , " ". , , ? , ?