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

133
Views
Using reduce you need to create a new array that contains all the names from the initial array

i have this array

const names = [
  { name: 'Anna' },
  { num: 27 },
  { name: 'Valeria', age: 20},
  { secondname: 'Wilson' },
  { age: 12, name: 'Max' },
  { weight:'50kg', height: '172cm', name: 'Nick' }
] 

using reduce i need to create new array that contains all names from initial array i made like this, but i think it is bad

let allNames = names.reduce((previousValue, names) =>{
  return previousValue + names.name},[])
console.log(allNames)

i did

   allName.push(ar.name);
 
   return allName;
 }, []);
 
 console.log(names);```
about 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
Show me some job opportunities
There's an error!