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

203
Vistas
filter through array values inside object

I have an array of objects as below, I want to get the whole object where badge has outreach word. I tried to filter and find but it only give me a single word in the array, not the full object. Please help me sort this out, thanks.

carData: [
  {
    flowName: "Cars",
    badge: ["content", "outreach"],
    image: icons.car,
  },
  {
    flowName: "linkedin",
    badge: ["content"],
    image: icons.linkedin,
  },
  {
    flowName: "facebook",
    badge: ["content"],
    image: icons.facebook,
  },
]

This is what I've tried:

console.log(state.carData.map(({badge}) => (badge.filter(i => i==="outreach"))).find(badge=>badge.length>0));

It gives the result ['outreach'].

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

const carData = [{
    flowName: "Cars",
    badge: ["content", "outreach"],
    image: "icons.car",
  },
  {
    flowName: "linkedin",
    badge: ["content"],
    image: "icons.linkedin",
  },
  {
    flowName: "facebook",
    badge: ["content"],
    image: "icons.facebook",
  },
]

console.log(carData.filter(car => car.badge.includes("outreach")))

about 4 years ago · Juan Pablo Isaza Denunciar

0

carData.filter(x=>x.badge.includes("outreach"))
about 4 years ago · Juan Pablo Isaza Denunciar

0

Try this

carData.filter((car) => {
  car.badge.includes("outreach")
})
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