why is this code returning a promise instead of an object?
const getJSON = function (url, errorMsg = "Something went wrong") {
return fetch(url).then((response) => {
if (!response.ok)
throw new Error(errorMsg+". Error Code: "+response.status);
return response.json();
});
};