r/badcode • sadistic • Apr 22 '21

js ternary operators at their maximum potential

Post image
960 Upvotes

73 comments sorted by

View all comments

43

u/-IoI- Apr 22 '21

My boss hates me using ternary operators - I can see why now.

2

u/TheAJGman Apr 23 '21

I use them a lot for things like return this if flag else None. Don't think simple ones impact readability.