Is that it? Or are there more conversions?
A: There are some other places where conversion happens. For instance, the unary operator - (to make a negative number) will turn -true into -1. And concatenating a boolean with a string will create a string (like true + “love” is “true love”). These cases are fairly rare, and we’ve personally never needed these in practice, but now you know they exist.
- 7. Types, Equality, Conversion and All That Jazz: Serious types
- Publisher: O'Reilly Media, Inc.
- Released: March 2014
What happens when you concatenate string and boolean?