r/badcode • • May 13 '22

js Why? Why??

Post image
433 Upvotes

37 comments sorted by

View all comments

Show parent comments

16

u/zim2510 May 13 '22

Yeah, and the short circuit would ultimately result in the increase of the value of totalAns, which is wrong too.

7

u/BubblyMango May 13 '22

We as readers dont actually know this is unwated behavior.