1
Hello, I’m a little new in the Javascript universe and its asynchronous. I have the following asynchronous function below. When entering the condition "!= null", I wish it to be terminated and the following functions will not be performed. However, a "Return" is simply not working.
async function register() {
await checkExists(id)
.then(string => {
if(string != null) {
// return - parar a execução do resto aqui;
}
})
await getString(id)
.then(string => {
// Próxima função...
})
}
Can someone help me?