SHARE
TWEET

Untitled

a guest Jul 18th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var promise = new Promise(function(resolve, reject) {
  2.     resolve('This is just a statement in resolve');
  3. })
  4.  
  5. promise
  6.     .then(function(successMessage) {
  7.     //Success Handler invoked since promises sends a resolve
  8.         console.log(successMessage); // This will print
  9.     }, function(errorMessage) {
  10.         console.log(errorMessage); //This won't execute
  11.     })
  12.  
  13. //OUTPUT
  14. This is just a statement in resolve
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top