Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Producing a Promise

const p = new Promise(
    function (resolve, reject) { // (A)
        ···
        if (···) {
            resolve(value); // success
        } else {
            reject(reason); // failure
        }
    });
Source by exploringjs.com #
 
PREVIOUS NEXT
Tagged: #Producing #Promise
ADD COMMENT
Topic
Name
1+3 =