Files
JavaScript-from-Beginner-to…/Chapter 13/Exercise_13.2.js
T
2021-12-03 14:34:47 +05:30

14 lines
333 B
JavaScript

const myPromise = new Promise((resolve, reject) => {
resolve("Start Counting");
});
function counter(val){
console.log(val);
}
myPromise
.then(value => {counter(value); return "one"})
.then(value => {counter(value); return "two"})
.then(value => {counter(value); return "three"})
.then(value => {counter(value);});