▲ | akira2501 3 days ago | |
> Why can't I await in a normal function? You can. promise.then(callback). If you want the rest of your logic to be "blocking" then the rest of it goes in the callback. the 'then' method itself returns a promise, so you can return that from a non async function, if you like. > why can't I launch multiple async functions, then await on each of them, in a non-async function that does not return a promise? Typically? Exception handling semantics. See the difference between Promise.race, Promise.all and Promise.allSettled. |