Brian Gordon
2 min readFeb 19, 2021

DOM manipulation…

Third party API continued…

Now that we have successfully connected to our third party api and are getting data back…. lets figure out what to do with it.

The second promise is specifying that after we have our JSON data we want to call it results and then finally Im console.logging the results which will come back like this.. after this we can now go back into our function and handle our data

This is called a handler function… we could open up a fat arrow function off the second promise and start creating elements and appending them to the dom… but for clarity and single responsibility reasons, a helper function is the way to go. And what see getting console.logged out in this handler function is bizarre… we called our results results inside the promise… we can change that variable to whatever we want! But the data was stored from the 3rd party as results… so we are calling reasults.results… the [0] indicate that I want to specify the first index of the array and .name will bring back that property… which is …

No responses yet