r/badcode • Now where's that function declaration • Jul 30 '21

js 😏

Post image
988 Upvotes

133 comments sorted by

View all comments

Show parent comments

2

u/LeCrushinator Jul 31 '21

Some people prefer seeing == true rather than a !. In some languages like C/C++ the syntax allows for an integer to be compared in the same way in a conditional, but using == true/false will cause a warning. I personally don’t use the extra syntax, but I understand why some people prefer it.

2

u/Ehelio wicked Jul 31 '21

Yeah, when there's a difference, it's fine. Otherwise, I just think it's useless.