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
Nenepo -
Xiaoyun Zhang -
Rails Designer -
DotNet Full Stack Dev -
Top comments (0)