Frage im Vorstellungsgespräch bei CACI International

In JavaScript, what is the difference between == and ===?

Antwort im Vorstellungsgespräch

Anonym

23. Mai 2017

== checks for equality as in any language, but doesn't care for types, so 5 == "5" is true, even though one is a number and one is a string. === will also check the types are the same. (So in a sense == will cast accordingly).

2