Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

then js

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: #js
ADD COMMENT
Topic
Name
1+7 =