What is javascript promise then

What is Promise ?

Let us discuss about promise with an example .An eventual operation will have two scenarios , it can be successful operation or it can be a failure operation . But how can we configure our code snippet to react for both success and failure . It means when that particular operation is success , it has to execute one code snippet and when it failed  it has to execute the other code snippet.

Here comes the Promise . In the promise you can handle both the success and failure .


Comments