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

251
Views
how can i find an object from an array [ i want to find findIt object from cartItem ]
const findIt = {
    productId: "htm-45",
    attribute: [
        {name:"size",index:2},
        {color:"red",index:2}
    ]
}

const cartItem = [
    {
        productId: "htm-45-34",
        atrributeId:"_672349e",
        attribute: [
            {name:"size",index:1}
        ]
    },
    {
        productId: "htm-45",
        attribute: [
            {name:"size",index:2},
            {name:"size",index:3},
        ]
    },
    {
        productId: "htm-45",
        attribute: [
            {name:"size",index:2},
            {color:"red",index:2}
        ]
    }
    
]
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

const idToSearch="htm-45"
const findIt = cartItem.find((item)=>item.productId===idToSearch)

Go through MDN docs

about 4 years ago · Santiago Trujillo 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!