Pregunta de entrevista de Oracle

Difference between == and ===. basic questions on loops, array.

Respuesta de la entrevista

Anónimo

28 de dic de 2021

The difference between both the operators,“==” is used to compare values whereas, “ === “ is used to compare both value and types. var x = 2; var y = "2"; (x == y) // Returns true since the value of both x and y is the same (x === y) // Returns false since the typeof x is "number" and typeof y is "string"