I am working with asynchronous javascript and am having the hardest time figuring out how to do this:
When I send a get request to [a star wars data site], it returns an object that has a key called results, which has a value of each film and all of the data, including an array of planets. The tricky part is the array of planets are only more links to the API that need ajax requests for data.
I need to loop through the array of planets for each movie and make more AJAX calls to collect the name of each planet, organized by film. Then, console log an array of objects in which each object contains the opening crawl for a specific movie, along with the names of every planet featured in that movie.
What I have tried:
So far I have finished a function that can console log opening_crawls. I am honestly unsure where to start with this issue? Do I need to use promise.all? I am just learning about async code.