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
Mykolas Mankevicius -
Roshan Kr Soni -
Devluc -
Ukeje Chukwuemeriwo Goodness -
Top comments (0)