It is type coercion. The runtime converts both operands to the same type before making the comparison (
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...). This is also true of !, <, and friends.
Other operators in JavaScript may behave more intuitively than ==, but I don't think you can really make a good case for JavaScript's type coercion being 'unsurprising'.