JavaScript expects you to handle errors with try...catch, but the syntax is somewhat inconvenient:
1. You have to declare result variables separ...
For further actions, you may consider blocking this person and/or reporting abuse
This is kind of like a poor man's
Either
!What is this abomination:
😱
You cannot use
async/await
in the global scope. By wrapping your code in anasync
function, this trick will let you useawait
.Are you sure about that? I know that you can't use
await
withoutasync
but if I remember correctly I've usedasync
function in top-level scope a few times 🤔Anyway, I was thinking about that semicolon at the beginning which purpose is to guard against AST, confusing and ugly syntax IMO.
You can test by pasting an
await
command into the browser console.Ahh ya. It's just a guard.
Where does the
dx
name come from? What does it mean?It could mean a lot of things? Developer Experience, De-Exception, Derivative, Ducks, etc.
I like the first 2 definitions best. Besides that, it's just short and convenient to type.
You could always copy the module into your project!
npm
is just there as a convenience.You Javascript people need Monads, or some decent metaprogramming, or macros, whatever make you stop creating libraries from every single useful snippet of code out there
good idea