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

181
Visualizações
Cómo usar lodash para filtrar matrices y objetos

¿Hay una mejor manera para mí de codificar esto? El código actual funciona, pero estoy buscando una mejor manera de codificar. El código debe usar lodash. Me imagino que pueden ser una forma de filtrar donde no tengo que crear 2 filtros y luego unirlos

 const overwriteExisting = () => { // get data that does not have midiChannl = 5 const filtered1 = filter(data, function (o) { return o.midiChannl !== 5; }); // filter out everything that does not have same midiValue hello2 const filtered2 = filter(dataWithoutCurrentUUID, function (o) { return ( o.midiValue !== 'hello2'; ); }); const joinAll = concat(filtered1, filtered2); console.log(joinAll) } { midiType: 1, midiValue: "hello", midiChannl: 5 }, { midiType: 10, midiValue: "hello2", midiChannl: 4 }, { midiType: 100, midiValue: "hello2", midiChannl: 4 }, { midiType: 1000, midiValue: "hello4", midiChannl: 4 }
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

¿Funcionaría esto? No está claro si los filtros se aplican a la misma matriz de datos.

 const overwriteExisting = () => { // get data that does not have midiChannl = 5 and does not have same midiValue hello2 const filtered = filter(data, o => o.midiChannl !== 5 && o.midiValue !== 'hello2' ); console.log(filtered) }
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