Skip to content

Still a Promise #3808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update solution2.md
  • Loading branch information
joaquinelio authored Nov 6, 2024
commit 8d0d84dc5f76d39305c08b8954ec30a486b1ed8b
4 changes: 2 additions & 2 deletions 1-js/11-async/08-async-await/04-still-a-promise/solution2.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async function race() {
const results = await Promise.all([
babieca.run(),
rocinante.run(),
belcebu.run()
bucephalus.run()
]);

alert("All the horses reached the goal! 🎉🏇\n" + results.join('\n'));
Expand All @@ -23,6 +23,6 @@ This has no cost for your code. The horses run simultaneously. You may see when

Please note: if you only care for the fastest horse, you may use `promise.any` so you dont even need to wait for the slower ones

const fastest = await Promise.any([babieca.run(), rocinante.run(), belcebu.run()]);
const fastest = await Promise.any([babieca.run(), rocinante.run(), bucephalus.run()]);
alert(`The winner: ${fastest}`);