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

234
Views
Encuentre el valor máximo en un objeto Javascript e imprima todos los valores

Pido disculpas, pero soy muy nuevo en JavaScript. Tengo un objeto de juguete derivado de dos matrices. Lo que quiero hacer es encontrar el valor más grande del parámetro make (es decir, make = 3) y obtener un objeto que tenga todos los parámetros (es decir, make y model) de make iguales a 3

 const arr1 = [1, 2, 3]; const arr2 = ['a', 'b', 'c']; const myArr = []; for(i = 0; i < arr1.length; i++){ var myCar = new Object(); myCar.make = arr1[i]; myCar.model = arr2[i]; myArr.push(myCar) } console.log(myArr); >>> [ { make: 1, model: 'a' }, { make: 2, model: 'b' }, { make: 3, model: 'c' } ] var mm = Math.max(...myArr.map(o => o.make)) console.log(mm) >>> 3

Deseo {make: 3, model: 'c'}

over 4 years ago · Santiago Gelvez
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
Virtual assistant