15. Promise, Promise chaining, then catch & async await in javascript | interview questions in Hindi

CODERS NEVER QUIT
CODERS NEVER QUIT
222 بار بازدید - 7 ماه پیش - In this video we will
In this video we will learn about promises in javascript

00:00 - Promise
03:23 - then catch
09:50 - promise chaining
14:40 - async await vs then catch

#asyncawait #javascript #promises  

A Promise is a proxy for a value not necessarily known when the promise is created. It allows you to associate handlers with an asynchronous action's eventual success value or failure reason. This lets asynchronous methods return values like synchronous methods: instead of immediately returning the final value, the asynchronous method returns a promise to supply the value at some point in the future.

A Promise is in one of these states:

pending: initial state, neither fulfilled nor rejected.
fulfilled: meaning that the operation was completed successfully.
rejected: meaning that the operation failed.

The eventual state of a pending promise can either be fulfilled with a value or rejected with a reason (error). When either of these options occur, the associated handlers queued up by a promise's then method are called. If the promise has already been fulfilled or rejected when a corresponding handler is attached, the handler will be called, so there is no race condition between an asynchronous operation completing and its handlers being attached.

A promise is said to be settled if it is either fulfilled or rejected, but not pending.

connect with me on -
facebook :Facebook: mukesh.phulwani.5
instagram : Instagram: mukeshphulwani66
linkedin: LinkedIn: mukesh-phulwani-681450152
github: https://github.com/mukeshphulwani66
codersneverquit website : https://www.codersneverquit.in/
7 ماه پیش در تاریخ 1402/09/18 منتشر شده است.
222 بـار بازدید شده
... بیشتر