DEV Community

Discussion on: Avoid use IF on our JS scripts

Collapse
mattdimu profile image
Matthias Müller

While you've shown some nice alternatives for IF, most of these examples feel less readable after being refactored. Especially chaining the ternary operator should be avoided IMHO.

Collapse
damxipo profile image
Damian Cipolat Author

Yes in the refactor, some of semantic is lost. The chaining ternaries is the most extreme. Consider this things as example you can chose use it or not.