Create promises

This commit is contained in:
LSvekis
2021-10-01 12:05:40 -04:00
committed by GitHub
parent 1168c928e7
commit 8fe3b65141
+13
View File
@@ -0,0 +1,13 @@
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);})