Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

promise

new Promise( (res, rej) => {
  setTimeout(() => res(1), 1000);
}).then( (res) => {
  console.log(res); // 1
  return res*2
}).then( (res) => {
  console.log(res); // 2
});
Source by javascript.info #
 
PREVIOUS NEXT
Tagged: #promise
ADD COMMENT
Topic
Name
3+6 =