Home > DeveloperSection > Interviews > What is the difference between == and === ?

Posted on    December-07-2012 8:50 AM

 JavaScript JavaScript 
Ratings:
 1 Answer(s)
  1957  View(s)
Rate this:

Vijay Shukla

Total Post:81

Points:405
Posted on    December-07-2012 1:00 AM

The 3 equal signs mean "equality without type coercion". Using the triple equals, the values must be equal in type as well.

== is equal to
=== is exactly equal to (value and type)
0==false // true
0===false // false, because they are of a different type
1=="1" // true, auto type coercion
1==="1" // false, because they are of a different type


Don't want to miss updates? Please click the below button!

Follow MindStick