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

246
Views
How to resolve a promise with an array of results from a different promise?

I have a promise which is supposed to be resolved with an array. Each element of the resulting array is a result of a lengthy asynchronous operation itself, similar to this:

new Promise(resolve, reject) {
  const arr = [param1, param2, param3];
  const resultArr = [];

  async function foo(param) { return await ... };

  arr.forEach(param) {
    resultArr.push(foo(param));
  }
  
  resolve(resultArr);
}

The code above resolves with an array of unresolved promises, instead of actual values.

about 4 years ago · Juan Pablo Isaza
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!