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
Dev Girl -
A0mineTV -
Rohith Singh -
Wolfgang Rathgeb -
Top comments (0)