+ 1

JavaScript difference between === and ==

22nd Sep 2019, 6:05 AM
Praveenkumar
Praveenkumar - avatar
4 odpowiedzi
+ 8
== uses type correction while checking ( 0 == "0" gives true) while === doesn't. Pro tip - use ===. And this is something you might find funny & informative (about how == handles things, coercing) ~ https://www.freecodecamp.org/news/explaining-the-best-javascript-meme-i-have-ever-seen/
22nd Sep 2019, 6:13 AM
Nikhil
Nikhil - avatar
+ 1
https://code.sololearn.com/W2zCXFE23QGi
22nd Sep 2019, 6:32 AM
Anthony Johnson
Anthony Johnson - avatar
+ 1
== : It compare value not its type but === : It compare value with its type
23rd Sep 2019, 4:54 PM
OverSmart
0
== means equal to whttps://code.sololearn.com/W2zCXFE23QGihile === means equal to and same type or identical.
22nd Sep 2019, 6:14 AM
Anthony Johnson
Anthony Johnson - avatar