I'm not quite sure how async/await works in JS. Sometimes, I see people writing like the first function and sometimes the second. I wonder, Is there any difference between the two usages of async/await within the functions below?
And how to properly use it?
async function fetchSomething() {
return await fetch('/article/promise-chaining/user.json');
}
VS
async function fetchSomething() {
return fetch('/article/promise-chaining/user.json');
}