Note that response.json() returns a PROMISE. This is a common misconception. This article is a wee bit misleading in the async / await example, the data variable will be a promise but the example sort of makes it seem like response.json() is sync by not using await in front of the call.
Note that response.json() returns a PROMISE. This is a common misconception. This article is a wee bit misleading in the async / await example, the data variable will be a promise but the example sort of makes it seem like response.json() is sync by not using await in front of the call.
What is a Promise?
Take a look at MDN
developer.mozilla.org/en-US/docs/W...
Thank you for spotting that out Mattias, it was a mistake, and the code as been edited.
Cheers.