3 ms·
It wasn’t that callbacks we’re a selling point, it’s that asynchronous execution was. Callback were just the way of doing that in JS. Now we have Promises + As
by abritinthebay 9y ago
It wasn’t that callbacks we’re a selling point, it’s that asynchronous execution was.
Callback were just the way of doing that in JS. Now we have Promises + Async/Await as sugar around what is basically the same pattern
ie - cb(err, result) is not that different than .catch(err).then(result) but it’s much nicer to develop with.
Of course now you can do the same in imperative try/catch for with await so yes, we’re back to similar syntax but a whole lot change under the hood and provided a much more performant concurrent model