Mode entretien. Minuteur de 3 min, sans indices ni autocomplétion
Add two promises
FacileAsync code3 min
Write a function addTwoPromises(promise1, promise2). Each promise resolves with a number. Return a promise that resolves with the sum of the two numbers.
Exemples
await addTwoPromises(Promise.resolve(2), Promise.resolve(5))Renvoie 7
Chargement de l'éditeur...
- Promises of 2 and 5 give 7
- Promises that resolve after 100 and 50 ms
Les tests cachés se lancent à la soumission