Javascript promises (“Can be Fulfilled | Rejected”) can be considered as the asynchronous counter part of a getter function. Javascript is a single threaded & Only one thing can happen at a time, on a single main thread. To avoid promise chaining and to write clean code, we have async & await. Async Await acts as syntactic sugar on top of promises, making asynchronous code easier to write and read.
3 Comments
Sort: