Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

194
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda