Pergunta de entrevista da empresa Paylocity

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

Resposta da entrevista

Sigiloso

22 de jan. de 2016

Since JavaScript is a loosely typed language, the identity operator or '===' doesn't convert both variables to the same data type before comparing equality, whereas the equality operator or '==' does. In order for two variables to be equal using the identity operator they must both be of the same type and value, whereas with the equality operator only the value needs to be the same.

1