actually, it compares both the value and the type of the things you're comparing.
So while
'3'==3 evaluates to "true",
'3'===3 is false.
and likewise:
'3'!=3 is false
but
'3'!==3 is true
(because the value of '3' is 3, which is equal to the value of 3, but the type of '3' is a string, which is not equal to the type of 3, which is an integer)
1 comment:
actually, it compares both the value and the type of the things you're comparing.
So while
'3'==3 evaluates to "true",
'3'===3 is false.
and likewise:
'3'!=3 is false
but
'3'!==3 is true
(because the value of '3' is 3, which is equal to the value of 3, but the type of '3' is a string, which is not equal to the type of 3, which is an integer)
Post a Comment