Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript promise example basic

const anotherPromise = new Promise((resolve, reject) => {
  setTimeout(() => {
    resolve('this is the eventual value the promise will return');
  }, 300);
});

// CONTINUATION
anotherPromise
.then(value => { console.log(value) })
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #javascript #promise #basic
ADD COMMENT
Topic
Name
6+1 =