Created
August 16, 2013 01:42
-
-
Save objectiveSee/6246542 to your computer and use it in GitHub Desktop.
How can I save the value of foo from changing code in this function only?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(request.args.game_id === undefined) { | |
var foo = undefined; | |
Game.transactById(request.args.game_id, function(err, game) { | |
foo = game.participantDiscards(request.getUserId(), request.args.card_id_array); | |
}, function(err, game) { | |
if(err) { | |
request.onError(err); | |
} else { | |
// HERE I WANT ACCESS TO foo BUT IT IS UNDEFINED HERE YET DEFINED INSIDEtransactById | |
request.onSuccess(foo); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment