+ 3
What is the difference between == and === ?
we == for comparing value then why === is used. when we == it only compares value not datatype so when we use === it will compare data type also ex:5 and '5' are different one int and another is string so it should wrong but it will you true in == becoz.. if you use === then it will you false
7 odpowiedzi
+ 17
== compares only value but === compares both the value and type.
12 == "12" is true
12 === "12" is false since data types are different
+ 5
in JavaScript:
Semantic wise:
== checks for equality, i.e. it will compare the value of two objects will return true if they are, else false if they aren't
=== checks for identity, i.e. it will compare the value and the type of two object. If both match, then it will return true, otherwise false.
Performance wise:
=== is faster than == since it doesn't cast the type of both to be compared objects. Once it notice that two objects are of different type it returns false. Therefore === is faster than ==.
+ 2
I can't see the tag
+ 1
* the "===" operator doesn't exist in htlm, c++ and java
+ 1
@toky Html is not a programming language, its a markup language.
0
yep
0
@xCalifier, I know html isn't a programing language. I mentioned it because he taged it