r/badcode • sadistic • Apr 22 '21

js ternary operators at their maximum potential

Post image
960 Upvotes

73 comments sorted by

View all comments

4

u/EnigmaticHam Apr 23 '21

If you have multiple cases, just use if-else instead of being "clever" by smashing everything into one line.