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

196
Visualizações
compare specific values from objects with different keys Javascript

This is a silly question, but nothing I try works. I have two objects nft and web3.givenProvider. Both contain an address as "0x0000000000000", but they are under separate keys. nft is under .seller and web3 is under .selectedAddress. Whenever I try to compare them using _.isEqual or toString it returns false even though the values are correct. I am not sure what I am missing here. I have even tried converting to an array and trying to _.find the address in the array, but that returned false.

// removed question mark
console.log(nft.seller === web3.givenProvider.selectedAddress))

NFT console.log() NFT console.log

Web3 console.log() Web3 console.log

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

They dont equate to each other because NFT has upper case letters while Web3 has all its letters on lowercase. If both values should be case insensitive, convert both to the same case (lower/upper) then compare them.

Sample:

console.log(nft.seller.toLowerCase() === web3.givenProvider.selectedAddress.toLowerCase())
about 4 years ago · Juan Pablo Isaza Relatório
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