Probably this question has been asked before, I did my "Google homeworks" without results (it's kind of difficult to ask this as a question).
I find myself doing this often with async callbacks:
var wow;
myFunction(function(something) {
wow = something;
});
Is there a shorthand to assign the value contained in the callback function to a variable, like above?
I can't change the code of the myFunction.
Possible real case scenario (with Angular):
$http.get(url).success(function(res) {
$scope.data = res;
}