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

150
Visualizações
Comparing items in ojects in two arrays js

I have seen some answers on how to compare two arrays in javascript, but my problem is a little bit different. My arrays contain objects with values that I want to compare.

I have two arrays (of different lengths), example here for brevity:

let arr1 = [
  {
    name: "something"
  },
  {
    name: "somethingElse"
  }
]

let arr2 = [
  {
    nickname: "somewhere"
  },
  {
    nickname: "something"
  },
  {
    nickname: "who"
  }
]

I want to be able to find a way to check if the same value exists in both arrays.

I imagine it's some sort for sort / includes / for loop, but I just can't get the syntax to say:
Check arr1, see if any of the name values match the nickname values in arr2. Return the items in the arr2 array that do (or don't) match

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