function(callback) { api('http//api.somesite.com/getCurrentUser', function(err, currentUser) { if (err) { callback(err); } else { api('http//api.somesite.com/user/' + currentUser.id + '/friends', callback); } }); }, function(callback) { api('http//api.somesite.com/listPeople', callback); } ], function(err, res) { var currentUserFriends = res[0]; var listPeople = res[1]; var notFriends = listPeople.length -‐ currentUserFriends.length; console.log("not friended: " + notFriends); });