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

158
Views
Devuelve un valor de un objeto de valor múltiple en Javascript según los criterios

Digamos que tengo una matriz de objetos que se ve así:

 var obj1 = [{ fullName ='Jon Doe', Name ='Jon', age ='17', }, { fullName ='Bob Smith', Name ='Bob', age ='34', } ]

Si tengo un var CustomerName = 'Jon' , ¿cómo puedo recuperar la age de Jon?

 var cName = obj1.filter(function(item)){ return item['age'] //?? Where item['name'] == customerName }

Estoy un poco perdido, ¿estoy en el camino correcto? Gracias.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Estás buscando algo como esto:

 const filtered = (item) => { item.name === customerName } return obj1.filter(filtered).forEach((obj) => obj.age)
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!