promise in javascript es6 code example
Example: promises in javascript
myPromise.then(
function(value) { /* code if successful */ },
function(error) { /* code if some error */ }
);
myPromise.then(
function(value) { /* code if successful */ },
function(error) { /* code if some error */ }
);