I have the following code:
let a = async () => {
let b = await c()
console.log(b)
}
let c = () => {
setTimeout(async () => {
return true
}, 0)
}
a()
In a(), I want c() to wait until its setTimeout has finished and returned the true value before assigning it to b. So I want the console.log to log true instead of undefined. Can anyone explain why it's returning undefined and advise me on how to modify it to return true?