javascript promise .then code example
Example 1: nodejs promise then example
p.then(onFulfilled, onRejected);
p.then(function(value) {
// run
}, function(reason) {
// fail
});
Example 2: .then javascript
const promise2 = doSomething().then(successCallback, failureCallback);