fastsync.js
function makeCountNCallback(n, cb) {
        var count = 0,
            results = [],
            error;
        return function(index, err, result) {
            results[index] = result;
            if (!error && err) {
                error = err;
                return cb(err);
            }
            if (!error && ++count == n) {
                cb(null, results);
            }
        };
    }
function makeCountNCallback(n, cb) {
        var count = 0,
            results = [],
            error;
        return function(index, err, result) {
            results[index] = result;
            if (!error && err) {
                error = err;
                return cb(err);
            }
            if (!error && ++count == n) {
                cb(null, results);
            }
        };
    }
function makeCountNCallback ( n , cb ) { var count = 0 , results = [ ] , error ; return function ( index , err , result ) { results [ index ] = result ; if ( ! error && err ) { error = err ; return cb ( err ) ; } if ( ! error && ++ count == n ) { cb ( null , results ) ; } } ; }
Create a function that will call a callback after n function calls
Create a function that will call a callback after n function calls