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

158
Vistas
How to filter mapped array items within a object?

I have a table, which displays a list of Approved Attachments along with their document type in a table section called 'Attachments'. Which is part of a much larger tableData object.

These attachments have a property of `'isApproved' (along with .name & .typeName), I only want to display the properties where this is true, however I'm not sure how to filter the below code to say 'where x.isApproved === true' for example.

attachments: {
              name: data.attachments.map((x) => x.name).join(','),
              documentGroup: data.attachments.map((x) => x.typeName).join(','),
             },
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Adding a filter in the beginning of the chain should do the trick

attachments: {
  name: data.attachments.filter(x => x.isApproved).map((x) => x.name).join(','),
  documentGroup: data.attachments.filter(x => x.isApproved).map((x) => x.typeName).join(','),
},
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