Possible Duplicate:
Javascript === vs == : Does it matter which “equal” operator I use?
What are the differences between ===
vs ==
and !==
vs !=
?
When should you use each one?
=== is the Identity operator, and is used to test that value and type are equal.
so..
"3" == 3 // true
"3" === 3 // false
1 == true // true
1 === true // false
"1" == true // true
"1" === true // false
so when you care that value and type are equal, or not equal use Identity operators === or !==