Possible Duplicate:
Javascript === vs == : Does it matter which “equal” operator I use?
Looking into the answer of Chris Brandsma in Advanced JavaScript Interview Questions what is ===
in Javas开发者_开发百科cript.
If possible please provide a simple example
=== is the strict equal operator. It only returns a Boolean True if both the operands are equal and of the same type. If a is 2, and b is 4,
a === 2 (True)
b === 4 (True)
a === '2' (False)
vs True for all of the following,
a == 2
a == "2"
2 == '2'
=== is 'strict equal operator'. It returns true if both the operands are equal AND are of same type.
a = 2
b = '2'
a == b //returns True
a === b //returns False
Take a look at this tutorial.
please refer Strict Equality Check..
精彩评论