Did you know === also coerces type in JavaScript?

However, unlike ==, === will always return false if the types differ.

That == and === both perform type coercion under the hood in JavaScript is such a fun fact!

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:

If Type(x) is different from Type(y), return false.

Indeed there is a type comparison with ===, and if the types differ the result is always false.

Photo by Erol Ahmed on Unsplash

🤓 The physical therapist who writes JavaScript 💪 Web Developer 😎 Mentor 🧠 DPT 😄 SEO Expert 😁 React 😆 Jamstack 💬 Ask me anything 👉 DoctorDerek.com 👈

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store