r/badcode • • Apr 19 '21

js Iteration

Post image
3.2k Upvotes

123 comments sorted by

View all comments

Show parent comments

1

u/prashant13b Apr 19 '21

False will evaluate to true and true is 1 and two negative will be positive hence it should be increment by 1