Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
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 answers
Answer question

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 Report

0

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

0

Try this

carData.filter((car) => {
  car.badge.includes("outreach")
})
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!