I have a scenario where I am using two functions. In this case, I am calling cbf()
from func()
via callback, and although I am using await, the output of after callback
is displayed before the callback function.
function cbf(name, callback: Function) {
console.log(name)
callback("123")
}
function async func() {
await cbf("alice", function(aa) {
console.log(aa)
})
console.log("after callback")
}