Const in a try catch pattern
It’s annoying to declare variables outside the try/catch block to use them on the outer scopes.
Use .catch
instead on async tasks
You can skip the whole block:
On an error, result
is undefined
.
Source: Javascript set const variable inside of a try block