DEV Community

Discussion on: Why I'm phasing out ternary statements

Collapse
 
fennecdjay profile image
Jérémie Astor

Order is altered thought:
In C you would write:

bool is_nice = true;
const char *state = is_nice ? "nice" : "not nice";

not

bool is_nice = true;
const char *state = "nice" if is_nice else "not nice";