async function b(a) {
await a();
console.log('b finished');
}
function a() {
setTimeout(() => {
console.log('a called')
}, 1000)
}
async function exe() {
await b(a);
}
exe();
Asked
Active
Viewed 26 times
0

Ayush Singh
- 5
- 2
-
Where are the promises? None of your functions explicitly returns a promise. – jarmod Aug 11 '22 at 19:51
-
@jarmod I have to get the desired output using the promises? – Ayush Singh Aug 11 '22 at 19:54
-
make `a()` to return a promise that is resolved when the timeout is executed. – Pipe Aug 11 '22 at 20:11