Use then and catch to get result of async operation | Promise Advanced JS Simplified
@ApplyIT2021 #asyncawait #javascript #advancejavascript
This video demonstrates how to get result of an async operation using then and catch. When async function is called, it returns a promise object immediately. However, that promise object does not hold any result initially. The result, API data or error, becomes available at later point depending upon whether promise gets fulfilled or promise gets rejected. So the caller needs a way an efficient way to get this result instead of performing polling continuously to get data. The promise object provides then and catch methods to register our own logic in form of success callback and failure callback. When the promise gets settled, we get result of async operation in an asynchronous manner, instead of waiting for data continuously.
This video answers many questions related to reading promise:
What is then and catch in JavaScript
How then and catch works
How promise works
How to create promise
What is then and catch
How to register success callback using then
How to register failure callback using catch
How then and catch works with JavaScript promises
How to explain JavaScript promise, then, and catch
How to resolve promise in JavaScript
How to reject promise in JavaScript
How to chain calls on promise object
Watch previous videos
1. Difference between synchronous and asynchronous call using Analogy at • 01 Realize what you already know abou...
2. Understand What is Promise in Details
• 02 No further confusion about Promise...
3. All ways to create promise
• 03 Don't miss all ways to create Prom...
Playlist
• 01 Realize what you already know abou...