Fetch() is the JavaScript method used to get and post data to the server. It takes one required argument, the path(url) to the resource we want to fetch. A fetch request returns a Promise, which goes from pending to eventually fulfilled, resolving in a Response object. Then the program handles the response using the .then and .catch methods.
Table of contents
Asynchronous JavaScriptPromises, promises…That’s so fetch (sorry, I blame the 90s )The return value of fetch()The return value of .then() & why we need itThe return value of .json()The different ways that Promise objects resolveUnfulfilled PromisesSort: