Key takeaways: Promises can run code after some other code has completed async/await is just syntactic sugar Promise.all is great for parallel tasks What is a Promise? A promise is some task that we can use to chain together later tasks. For exampl...

Markdown supported · ⌘↵ to post
Axel Rauschmayer
I specialize in JavaScript.
Another option for parallelism:
const getAllUsersAndProducts1 = async () => { const [users, products] = await Promise.all([ fetchAllUsers(), fetchAllProducts(), ]); return { users, products }; };