+ 2

== and ===

what is the difference between equal and identical?

8th Aug 2017, 9:46 AM
Domces Games
Domces Games - avatar
8 Réponses
+ 3
In javascript, == only checks if the values are same, it doesn't care of datatypes. so, 3 == "3" is true. === on the other hand checks both values and datatypes. so, 3 === "3" is false.
8th Aug 2017, 9:50 AM
Salekin
Salekin - avatar
+ 6
== this is use for the same value === this is use for the same value and same datatype.
8th Aug 2017, 9:49 AM
Nithiwat
Nithiwat - avatar
+ 5
like String integer(numbers) characters
8th Aug 2017, 9:52 AM
Nithiwat
Nithiwat - avatar
+ 5
true "3" is string 3 is number
8th Aug 2017, 9:54 AM
Nithiwat
Nithiwat - avatar
+ 3
Don't attribute yourself the best answer mark @@ That doesn't give you any XP, show a bad image of you, and pervert the purpose of moving on top useful answer ^^
8th Aug 2017, 6:20 PM
visph
visph - avatar
+ 2
ok...stupid question...what is datatype? im soo sorry
8th Aug 2017, 9:51 AM
Domces Games
Domces Games - avatar
+ 1
you mean if 3 === 3 is true but 3 === "3" is false ?
8th Aug 2017, 9:53 AM
Domces Games
Domces Games - avatar
+ 1
ohhh ok thx really helped me
8th Aug 2017, 9:54 AM
Domces Games
Domces Games - avatar