Fetches

john Leonetti
2 min readJun 21, 2021

JavaScript oh JavaScript

This project was hard, but was also one of the most intriguing projects that I have done. This will be the area that I want to focus on, and want to get better at. I enjoyed having the ability in giving functionality to my application. There is a lot that goes with JavaScript, one part that I learned that will be a vital part are fetches. From fetching data to posting data this is a must to understand if you want to become a frontend developer. So what are fetches? Fetches and not playing fetch with your dog, but yet that is a good analogy, because a dog is bringing back something that was thrown. If the computer was the dog, we would be throwing a request asking for data to be fetched from from our API backend. The data is then being returned as a promise. A promise? Yes a promise, like we make promises everyday. Except a promise in computer language is making a fetch (or request that we asked for ) and the computer is making a promise to grab the info we requested and return it.

If we look a the code here to the left. We are fetching a nested url which is then making a promise to respond with a bunch of data information. We are asking for it to be returned to us in an object form using JSON(JavaScriptObjectNotation) format. We are then taking the data which is beers iterating over each beer object and creating a new beer that is associated with the brewery. Using fetches you are able to pull data and use use that data to publish an application for people to see.

--

--