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

220
Views
How to use map to get specific properties from array of objects

I have following part of code: I would like to create new Array of objects based on this arr but only with age and id property

const arr = [
  {
    name: "A",
    age: 1,
    id: 11,
  },
  {
    name: "B",
    age: 2,
    id: 22,
  },
  {
    name: "C",
    age: 3,
    id: 33,
  },
  {
    name: "D",
    age: 4,
    id: 44,
  },
];

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

0

Thanks for your question Try this:

var newArr=arr.map(item=>{
return  {
    id:item.id,
    age :item.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!