And within an async function, we use await keyword to make Javascript wait till the promise is settled.
I've already explained promise settling & am presuming you've read that thread.
If you haven't, please go through it here:
Let's now discuss await
I've already explained promise settling & am presuming you've read that thread.
If you haven't, please go through it here:
Let's now discuss await
π‘ Because async functions & promises complement each other naturally, the keywords 'async' and 'await' are usually used in pairs.
But as shown above, we can have an async function without the 'await' keyword.
Use of these two keywords makes asynchronous code look synchronous.
But as shown above, we can have an async function without the 'await' keyword.
Use of these two keywords makes asynchronous code look synchronous.
I write threads daily on web dev so if you enjoyed this thread, please:
β Follow me @sumitsaurabh927 for more of these.
β€οΈ Each like, every comment of y'all motivates me to come up with awesome new stuff!
β RT the tweet below to show me some love.
β Follow me @sumitsaurabh927 for more of these.
β€οΈ Each like, every comment of y'all motivates me to come up with awesome new stuff!
β RT the tweet below to show me some love.
Loading suggestions...