All Downloads are FREE. Search and download functionalities are using the official Maven repository.

g2701_2800.s2723_add_two_promises.solution.ts Maven / Gradle / Ivy

There is a newer version: 1.37
Show newest version
// #Easy #2023_09_18_Time_53_ms_(95.40%)_Space_43.2_MB_(24.42%)

async function addTwoPromises(promise1: Promise, promise2: Promise): Promise {
    return (await promise1) + (await promise2)
}

/*
 * addTwoPromises(Promise.resolve(2), Promise.resolve(2))
 *   .then(console.log); // 4
 */

export { addTwoPromises }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy