Did you know
=== will always return
false if the types differ.
Thanks for stopping by and sharing your knowledge with us Clyde Grey!!!
=== includes a type coercion as well.
It’s right there in the ECMAScript Specification:
11.9.6 The Strict Equality Comparison Algorithm
The comparison x === y, where x and y are values, produces true or false. Such a comparison is performed as follows:
Indeed there is a type comparison with
===, and if the types differ the result is always
But I had never really thought about it that way!
== compares values after type coercion but
=== will never return
true for values of different types.
Thanks again for sharing!