Possible Duplicate:
Javascript === vs == : Does it matter which “equal” operator I use?
Hi
I am not clear why there are two == and === comparator operators in java script.
Possible Duplicate:
Javascript === vs == : Does it matter which “equal” operator I use?
Hi
I am not clear why there are two == and === comparator operators in java script.
The equality operator == coerces, or converts the data type temporarily to see if it's equal to the other operand whereas the identity operator === doesn't need to do any converting whatsoever since it directly compares them without conversion meaning it's stricter and faster.
2=='2'
true
2==='2'
false
