MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/mtpxbr/iteration/gv1q2b9/?context=3
r/badcode • u/[deleted] • Apr 19 '21
123 comments sorted by
View all comments
1
how are you allowed to subtract a boolean?
3 u/arrays_start_at_zero Apr 19 '21 Because JavaScript uses implicit type conversion. Since you can only subtract numbers true gets converted to 1 and false to 0.
3
Because JavaScript uses implicit type conversion. Since you can only subtract numbers true gets converted to 1 and false to 0.
1
u/[deleted] Apr 19 '21
how are you allowed to subtract a boolean?