The first attempt:
type P = Promise<number>
async function addTwoPromises(promise1: P, promise2: P): P {
return (await Promise.all([promise1, promise2])).reduce((a: number, b: number) => {
return a + b;
}, 0);
};
The first attempt:
type P = Promise<number>
async function addTwoPromises(promise1: P, promise2: P): P {
return (await Promise.all([promise1, promise2])).reduce((a: number, b: number) => {
return a + b;
}, 0);
};
For further actions, you may consider blocking this person and/or reporting abuse
ElaFella -
Amit Yadav -
Muhammad Bilal -
James -
Top comments (0)