Frage im Vorstellungsgespräch bei Paylocity

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

Antwort im Vorstellungsgespräch

Anonym

22. Jan. 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