Maybe instead of this magic number you could count the number of things like

    var ops = [appendPrefs, settings, apps];
    var pending = ops.length;
    ops.forEach(function(op) {
    });