Pergunta de entrevista da empresa CACI International

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

Resposta da entrevista

Sigiloso

23 de mai. de 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