What is Async Await in JavaScript

Tue Jan 26 2021

Alt Text

Hi 👋
What is Async ? Let's understand with a basic example from our real world. Most of us have ordered food online via Zomato, Swiggy, etc or did online shopping from several apps in market. Assuming we ordered any food item, say Chicken Biryani(it's my fav, you can assume your fav food 😁).

Step 1. Order Chicken Biryani from app. Step 2. Complete all formalities(filling details). Step 3. Ah, Chicken Biryani arrives.😉 Step 4. Eat it now alone. (don't share)😁 Here when you order a food item, a promise is returned to you i.e. whether the food is ordered successfully or rejected(issue sometimes).

async can be placed before a function. When you put async before a function, it simply means that the function will return a promise. A resolved promise can have values wrapped inside it automatically.


Complete Blog here ...