3 ms·
Oh they work, but stacking them tends to make future reading of the code harder due to their increased complexity.
by TameAntelope 5y ago
Oh they work, but stacking them tends to make future reading of the code harder due to their increased complexity.
- kingdomcome50 5y agoNested ternaries can by structured to look a look like `if/else` if you put the `?/:` in the right spots. It's a balance. Extracting logic into new components (and often new files!) isn't exactly ergonomic either. I've found it's better to decrease readability if it makes understanding the logic more straight-forward (i.e. not hunting through several files to exhaust all possible outputs).