O'Reilly logo
  • Ahmed Elgendy thinks this is interesting:

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.


Cover of Head First JavaScript Programming


What happens when you concatenate string and boolean?