Why do I need the parameters === and !== in JavaScript?

While showing the content of MicrosoftAjax.debug.js in Lutz Roeder's fantastic .NET Reflector I got asked what the parameters === and !== in JavaScript are for (and unfortunately didn't have an answer 🙁 ). Well, as it turns out === and !== are Comparison Operators in JScript 5.6 and behave identically to the equality operators (== and !=) except no type conversion is done, and the types must be the same to be considered equal.
The details can be found in the article Comparison Operators (JScript 5.6) on MSDN.



Skip to main content