before learning how to use fetch we need to understand the word . A little googling define fetch as to go and bring back; return with; get. To translate that to the programming world fetch means to retrieve data by a software program and move the data to an alternate location or display it on a screen.
Here is the structure code of how to fetch
Fetch argument is a string URL. fetch can also have an optional second argument that includes information regarding the request you want to make to the database or API.
.then statement is always the same! It parses out the returned promise in JSON.
.then gets the response type and return’s it, the data from the API is being logged to the console via the the second promise in the Fetch request.