✳flâneur — a map of the web's best reading
'return await promise' vs 'return promise' in JavaScript
dmitripavlutin.com · 737 words · saved by 1 readers
Is there any difference between using 'return await promise' and 'return promise' in asynchronous JavaScript functions?
'return await promise' vs 'return promise' in JavaScript Posted August 10, 2021 javascript promise async -- Comments When returning from a promise from an asynchronous function, you can wait for that promise to resolve return await promise , or you can return it directly return promise : async function func1() { const promise = asyncOperation(); return await promise; } // vs async function func2() { const promise = asyncOperation(); return promise; } You'll see shortly that both expressions do work. However, are there cases when these expressions behave differently? Let's find out! 1. Same beh
Explore this link on the map →related reading
- Reading 15: Promisesweb.mit.edu
- What Async Promised and What it Delivered — Causalitycausality.blog
- JavaScript Async Promisesw3schools.com
- Microtasks and event looptr.javascript.info
- Reading 16: Mutual Exclusionweb.mit.edu
- Promise - JavaScript | MDNdeveloper.mozilla.org
- Futures and promises - Wikipediaen.wikipedia.org
- TypeScript Structured Concurrencythecandidstartup.org
- Let futures be futureswithout.boats
- async/await on embedded Rust - Ferrous Systemsferrous-systems.com
- My tutorial and take on C++20 coroutinesscs.stanford.edu
- python - How does asyncio actually work? - Stack Overflowstackoverflow.com