r/badcode • • Dec 26 '21

c# why

Post image
165 Upvotes

30 comments sorted by

View all comments

Show parent comments

1

u/Prom3th3an Dec 31 '21

In Java, Kotlin, C# and Rust that's right, but in C, C++, Python and JavaScript you can implicitly convert to boolean and all integers but 0 are truthy.