Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

promise

const myPromise = new Promise((resolve, reject) => {  
    let condition;  
    
    if(condition is met) {    
        resolve('Promise is resolved successfully.');  
    } else {    
        reject('Promise is rejected');  
    }
});
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #promise
ADD COMMENT
Topic
Name
5+4 =