Bifalgorithm post
What is a promise in JavaScript? A promise is like a promise in real life. For example, you order a burger. The restaurant promises to give you the burger. While waiting, you can do other things. Watch TV, scroll your phone. When the burger is ready. If you get the burger, you are happy, promise fulfilled. If they say no burger available, you are sad, promise rejected. Why do we use promises? In JavaScript, sometimes things take time, like downloading a file, fetching data from the internet, waiting for a timer. We don't want to wait and block everything. A promise helps JavaScript to say, "Hey, I will finish this work soon. You do your other tasks. I will tell you when I am done."
What is a promise in JavaScript? A promise is like a promise in real life. For example, you order a burger. The restaurant promises to give you the burger. Whi…
Ideas in this flowchart
- JavaScript Promise
- Promise Concept
- Real-life Analogy
- Order a Burger
- Promise Fulfilled
- Promise Rejected
- Use of Promises
- Asynchronous Operations
- Downloading Files
- Fetching Data
- Waiting for a Timer