This commit is contained in:
Karan
2021-11-30 18:44:31 +05:30
parent 547a908095
commit 9720a1f0fc
4 changed files with 0 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
let cnt = 0;
function outputTime(val) {
return new Promise(resolve => {
setTimeout(() => {
cnt++;
resolve(`x value ${val} counter:${cnt}`);
}, 1000);
});
}
async function aCall(val) {
console.log(`ready ${val} counter:${cnt}`);
const res = await outputTime(val);
console.log(res);
}
for (let x = 1; x < 4; x++) {
aCall(x);
}