JavaScript Async

Implement Promise.all

mediumJS SpecificJS / TS5 tests

Problem Statement

Implement a custom `promiseAll` function that accepts an array of promises (or values) and returns a single Promise that resolves to an array of results, maintaining original order. If any promise rejects, `promiseAll` rejects with that error immediately.

Examples

Example:
const p1 = Promise.resolve(42);
const p2 = new Promise((resolve) => setTimeout(() => resolve('hello'), 100));
promiseAll([p1, p2]).then(console.log); // [42, 'hello']
JavaScript & TypeScript starter code included
Run this as a live interview

Practice solo

5 test cases. No second person needed.

Get new interview exercises

Practice problems and review drills, sent when we publish new ones. No spam.

Unsubscribe anytime. We never share your address.