== vs ===
One thing common in both the cases is that they are comparison operator to check equality.
The only difference is '===' will match for both value and type.
Example:
1===1 returns true
1==="1" returns false (Number compared against String)
But 1=="1" returns true
!= vs !==
One thing common in both the cases is that they are comparison operator to check inequality.
The only difference is '!==' will match for both value and type.
Example:
1!==1 returns false
1!=="1" returns true (Number compared against String)
But 1!="1" returns false
One thing common in both the cases is that they are comparison operator to check equality.
The only difference is '===' will match for both value and type.
Example:
1===1 returns true
1==="1" returns false (Number compared against String)
But 1=="1" returns true
!= vs !==
One thing common in both the cases is that they are comparison operator to check inequality.
The only difference is '!==' will match for both value and type.
Example:
1!==1 returns false
1!=="1" returns true (Number compared against String)
But 1!="1" returns false
No comments:
Post a Comment
Please leave your comments here...