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 careerfoundry.com #
 
PREVIOUS NEXT
Tagged: #JavaScript #Promises
ADD COMMENT
Topic
Name
1+4 =