How do I return the object correctly in the following jQuery example:-
function get_stockists() {
$.getJSON("/stockists/ajax_get_all", function(data) {
//console.log(data);
});
}
var stockists = get_stockists();
console.log(stockists);