Optimize ternary operator
That’s just horrible code. It’s badly formatted. I don’t see the hierarchy of the expression. Even if it had good formatting, the expression would be way too complex to quickly parse with the human eye. The intention is unclear. What’s the purpose of those conditions? So what can you do? Use conditional statements (if). Extract … Read more