I recently found that AngularJS has supports for promises. I replaced some of the callback code to use promises and it's a lot more readable.
Callbacks:
Backend.CallA(param, function() {
aDone = true;
if (aDone && bDone) { doC(); }
});
Backend.CallB(param, function() {
bDone = true;
if (aDone && bDone) { doC(); }
});
Promises: var promiseA = Backend.CallA(param);
var promiseB = Backend.CallB(param);
$q.all([promiseA, promiseB]).then(doC);