Looks great. I love modern JS, and the faster everyone can move on, the better!
I didn't see any async/await stuff though, is there a reason for that? I'd imagine it would make some code much easier to follow.
I didn't see any async/await stuff though, is there a reason for that? I'd imagine it would make some code much easier to follow.
Why? Where does this mindset come from?
Do you really prefer callbacks or just use them because they were once necessary? Are they so good you'd use them for sync operations too?
add(a, b, function(sum){
....
})
Personally: that seems like a waste of time. I'd rather just do: var sum = a + b;
Likewise I'd rather do: var response = await superagent.get('https://...')Here's a code example from an npm package I was looking at, vs how I would rewrite it in modern JS:
https://gist.github.com/scf4/8157abd755eb9c232e87dcc342b78b4...
Some of it may be preference but a lot of it is objectively simpler to reason about.
I don't understand why anyone would choose to make things unnecessarily complex.