Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript promise

let promise = new Promise((resolve,reject)=>{
                try {
                    resolve("some data");
                } catch (error) {
                    reject(error);
                }
            })
            
            promise.then(function (data) {
                console.log(data);
            },function (error) {
                console.error(error);
            })
Source by stickynotepickles.herokuapp.com #
 
PREVIOUS NEXT
Tagged: #javascript #promise
ADD COMMENT
Topic
Name
2+6 =