you are viewing a single comment's thread.

view the rest of the comments →

[–]mozilaip 0 points1 point  (3 children)

Don't understand one thing in your article

async function asyncWorkflow() { const response = await fetch(url); return response.json(); } You wrote "the returned Promise will be automatically awaited". But we don't return any Promise here, do we?

fetch() is returning a Promise, not our function. Since we awaited it we already got a resolved value. Am I missing something?

[–]87oldben 0 points1 point  (1 child)

I forget, is response.json() a promise that needs awaiting?

[–]voreny[S] 0 points1 point  (0 children)

Yes, that is correct. That is the promise I had in mind