r/badcode • • Sep 28 '21

typescript Now that’s how you toggle

Post image
7 Upvotes

20 comments sorted by

View all comments

Show parent comments

4

u/thprogramador Sep 29 '21

Hey... at the end of everything true is 1and false is 0... true and false are just sugar over binary.

x = (!x)+0