Pergunta de entrevista da empresa ByteDance

Can you explain the difference between == and === in JavaScript?

Resposta da entrevista

Sigiloso

20 de nov. de 2024

== : Evaluating if a variable equals another by comparing only using their values. Example: "1" == 1 // true === : Evaluating if a variable is equal to another by comparing their values and data types. Example: "1" === 1 // false