I use the ternary operator a lot. I strongly believe it should be used with caution. Most of the time, I start with regular if-statements and reduce it to a ternary operator if I deem the condition and expressions simple enough, even though I realise that is extremely subjective. I never nest ternary operators.
value < threshold ? value : otherValue;
object.someState || object.someOtherState
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.