Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

twhat is a js promise

const promise1 = new Promise((resolve, reject) => {
  setTimeout(() => {
    resolve('foo');
  }, 300);
});

promise1.then((value) => {
  console.log(value);
  // expected output: "foo"
});

console.log(promise1);
// expected output: [object Promise]
Source by jscomplete.com #
 
PREVIOUS NEXT
Tagged: #twhat #js #promise
ADD COMMENT
Topic
Name
6+8 =