+ 2

Comparison operators: what does '===' and '!==' mean? Explain plz

14th Dec 2016, 8:01 PM
Djaber Meghar
Djaber Meghar - avatar
3 odpowiedzi
+ 1
=== and !== check types of compared variables and their values. For example let's check comparision of number and string: 9 !== "9" But 9 == "9" Types are different here.
14th Dec 2016, 8:56 PM
Ivan G
Ivan G - avatar
0
== is used to check values are equal or not example 8==8 returns true & 8==7 will return false != this means not equal to, just opposite of == example 8!=8 will return false here but 8!=7 returns true
14th Dec 2016, 8:07 PM
Morpheus
Morpheus - avatar
0
I don't understand why in JS if you compare a string and a float with the simple equal operator (==) you get true if one is String and the other not. Therefore, we have to use identical operator to get the real comparison string===float, false honey.
28th Dec 2016, 2:10 AM
Gian Carlos Juarez Velasquez
Gian Carlos Juarez Velasquez - avatar