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
Suraj Vatsya -
Frank William -
James -
Naseh -
Top comments (0)