Check out [this](https://stackoverflow.com/questions/27523765/how-does-js-type-coercion-work) and [this](https://stackoverflow.com/questions/523643/difference-between-and-in-javascript/523650#523650) answer for some explanation of javascript coercion.
– JeremyOct 12 '18 at 16:12