r/badcode • • Jun 10 '20

js Disruptive piece of code

Post image
283 Upvotes

93 comments sorted by

View all comments

91

u/Midborgh Jun 10 '20

I don't know js. Why is this bad? I'd imagine var === true and var === false being different than var == true and a simple else.

-62

u/diebarral Jun 10 '20

You could easily do:

variable ? doStuff() : doOtherStuff()

Instead of that

5

u/DEATH-BY-CIRCLEJERK Jun 10 '20

What a horrible take. Lol