2 ms·
Personally I think ternarys should die in a fire. I despise them. Like, of all the thing validly deserving of syntactic sugar... that's the case that's "importa
by TylerE 3y ago
Personally I think ternarys should die in a fire. I despise them. Like, of all the thing validly deserving of syntactic sugar... that's the case that's "important"? It's neither especially common, nor is the sugar very nice to read.
As soon as you need a 3rd leg you have to rewrite it as a full blown if/case/whatever anyway.
- jakelazaroff 3y agoNot sure why this is getting downvotes. Ternaries are at best a necessary evil in JSX. We'll all be rejoicing when pattern matching finally lands in JS [1]. [1] https://github.com/tc39/proposal-pattern-matching https://github.com/tc39/proposal-pattern-matching