I have this code that is not behaving as I expect it to. I've looked at several other questions, but the context seems not to be the same, so I'm asking a new one.
async function loadDefaultConfig() {
const response = await fetch("defaultSettings.json");
console.log(response.json());
}
This is printing Promise { <state>: "pending" }
in Firefox, but I was expecting not expecting to get a Promise after using await
. How is await
supposed to be used here in order to log the actual result of the fetch
?