I am trying to load a data from a url to a variable using .ready() but the alert box provides a undefined value, please help.
let getMasterProd = () => {
return fetch('url').then(data => data.json());
}
$( document ).ready(function() {
var data =getMasterProd();
alert(data);
});