I have a function called 'getAuthor' and inside there's an ajax events running (refer below)
function getAuthor(id){
$.get('http://www.connectnigeria.com/articles/wp-json/wp/v2/users/74',function(e){
var author = e.name;
console.log(author);
return author;
});
}
try to run from the console, you'll see it returns "undefined" while console.log display the expected response from the ajax call.
Any, ideas help please?