Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

280
Visualizações
comparing two object variables with == in javascript

as == in JavaScript is used for comparing two variables, but it ignores the datatype of variable, gives true here,

"abc"=="abc"
true

gives false here,

new String("abc")==new String("abc")
false

but this still why output is coming as false, as value of both is same abc string object, as javascript have new datatype of Symbol,

Symbol("abc")==Symbol("abc")
false
Symbol(new String("abc"))==Symbol(new String("abc"))
false

whats difference in both, what should be used in which scenarios, why both gives sameoutput?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda