4 ms·
Those who think of errors as exceptions can further be divided into group 2a) Those who prefer Promises syntax. And group 2b) Those who prefer async/await synta
by z3t4 5y ago
Those who think of errors as exceptions can further be divided into group 2a) Those who prefer Promises syntax. And group 2b) Those who prefer async/await syntax.
Also don't forget about co-routines:
co(function* () {
var user = yield getUser();
var comments = yield getComments(user);
});
Just replace "co(" with async, and yield with await, and you'll have async/await.