var wrapper = function() {
var condition; //boolean
$.get('url', function(data) {
console.log(data); //url
condition = true/false;
});
return condition;
}
when I do wrapper()
it returns always undefined
because of async nature of $.get
. How to I solve this issue?