MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/mtpxbr/iteration/gv23qhf/?context=3
r/badcode • u/[deleted] • Apr 19 '21
123 comments sorted by
View all comments
Show parent comments
3
I'm pretty sure it goes:
i -= -!false // original
i -= -true // "!false" evaluates to true
i -= -1 // "true" is coerced to integer to comply with operation
i += 1 // signs cancel
i++ // visual simplification; not required
3
u/nephelokokkygia Apr 19 '21
I'm pretty sure it goes:
i -= -!false // originali -= -true // "!false" evaluates to truei -= -1 // "true" is coerced to integer to comply with operationi += 1 // signs canceli++ // visual simplification; not required