You're waiting for your favorite snack to finish baking while you do something else, that’s how async await works.
Imagine you have a robot friend who can make pancakes. Normally, when you ask the robot to make pancakes, it stops everything and makes them right away. But with async, your robot says, “I’ll start making pancakes, but I won’t stop you from doing other things.” Then, when the pancakes are ready, you use await to say, “Okay, now let’s eat the pancakes.”
Like a Robot Helper
Without async await, it's like your robot has to wait for the pancakes to be done before helping you with anything else. But with async await, your robot can start making pancakes and then go help you clean up or play a game, all while still finishing the pancakes.
It’s like having a friend who starts drawing a picture, but doesn’t stop you from playing a game at the same time. When the picture is done, you both look at it together.
So async is “I’ll do this, but I won’t block you” and await is “Now let’s finish it together.”
Examples
- A baker uses a phone to order more flour while still making cakes.
- A waiter takes orders from multiple tables at the same time.
- A person texts friends while cooking dinner.
Ask a question
See also
- How Does JavaScript ASYNC/AWAIT is easy! ⏳ Work?
- How does TypeScript integration work?
- Functional JavaScript Tutorial #6 - What are predicates?
- 5 cm to inches?
- 1212 ~ Number Synchronicities ~ Are You Seeing This ?