I have a function that returns a promise. How can I wait for the promise to resolve snd then restart the code execution without using the .then()
callback? Or basically:
const returnValue = promiseFunc()
console.log(returnValue) // I want the promise to resolve before this executing
I know that this works:
promiseFunc().then(returnValue => {
console.log(returnValue)
})
but I have code which looks a bit like this:
for (/*conditions*/) {
// code
promiseFunct()
// code
}
I have no idea how to put that into a callback.