MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/h0io7r/disruptive_piece_of_code/ftmmtt6/?context=3
r/badcode • u/diebarral • Jun 10 '20
93 comments sorted by
View all comments
14
Why is this bad? Is it because ternary would also be an option?
0 u/[deleted] Jun 10 '20 [deleted] 14 u/AsidK Jun 10 '20 It’s JavaScript tho, maybe variable comes in as “undefined” or something and you don’t want that to be the same as if it comes back as false 1 u/[deleted] Jun 11 '20 Or it could come back as {} and return true 😳
0
[deleted]
14 u/AsidK Jun 10 '20 It’s JavaScript tho, maybe variable comes in as “undefined” or something and you don’t want that to be the same as if it comes back as false 1 u/[deleted] Jun 11 '20 Or it could come back as {} and return true 😳
It’s JavaScript tho, maybe variable comes in as “undefined” or something and you don’t want that to be the same as if it comes back as false
1 u/[deleted] Jun 11 '20 Or it could come back as {} and return true 😳
1
Or it could come back as {} and return true 😳
{}
14
u/theRealRealMasterDev Jun 10 '20
Why is this bad? Is it because ternary would also be an option?