Files
JavaScript-from-Beginner-to…/Chapter 13/Exercise 13.2
T
2021-11-24 22:13:28 +05:30

14 lines
332 B
Plaintext

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);})