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

139
Views
javascript return an filtered array of objects using .map() from an api response

I have this array of data which I want to manipulate and return another array of object with only what I need, so I was thinking when I receive the api data it is possible to create an map responses like:

const [stateData, setStateData] = useState({stateData:[]});


        Promise.all(promises).then(response => {
                let info = [];
                response.forEach(res => {
                    info = info.concat(res.info);
                });
               
        //and here to add my map:
        
      const myData = info.map(fiterData,index) => {
        return info [
        {"id":fiterData.id},
        {"name":fiterData.name},
        {"name":fiterData.description}
        // and so on ...
        ]
        }
         
     setStateData(info);
            });

and afterwards to access like myData.property ? So will work if will be used in this way ?

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