Thursday, July 11, 2013

difference between == and === in javascript

1.== is equal to
2.=== is exactly equal to
== checks only the value
=== checks value as well as type
Given that x=5,
if x==8 it returns false
   x==5 it returns true
x==="5"  returns false
x===5 it returns true.

No comments:

Post a Comment