Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript Promises

// returns a promise
let countValue = new Promise(function (resolve, reject) {
   reject('Promise rejected'); 
});

// executes when promise is resolved successfully
countValue.then(
    function successValue(result) {
        console.log(result); // Promise resolved
    },
 )
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #JavaScript #Promises
ADD COMMENT
Topic
Name
4+5 =