JavaScript Promise then() is an inbuilt function that returns a Promise. The then() method takes up to two arguments: callback functions for the success and failure cases of the Promise. Promises in JavaScript are an object representation of an asynchronous computation.

You can think of a promise as a placeholder for a value that hasn’t been computed yet. However, there’s no approach to get a promise’s value from the Promise directly, and for that, you need to call the then() function to register a callback that JavaScript will call when the value is computed.

Javascript Promise then

Javascript Promise then() registers two callbacks that will be called when the Promise’s asynchronous operation finished successfully (onFullfilled), or an error occurred (onRejected).

#Javascript

Javascript Promise then | Promise.prototype.then()
2.10 GEEK