callback-hell
callback-hell copied to clipboard
Illegal return statement
I think you should not write code as below:
if (err) return statusMessage.value = err
There will throw some error like: Uncaught SyntaxError: Illegal return statement
File Path: callback-hell/index.html
Then, how should be written this code?
We cannot return a assignment, if you do and you will get an error as above. So, you just need change returns as below.
if (err) {
statusMessage.value = err
return statusMessage.value
}