Cannot read property of undefined- assignment 5

:raised_hand: removed screenshots

I’m having an issue while trying to do the last part of assignment 5. Basically, when I try to call my helper functions I get an error message that it cannot read property of undefined in reference to listedPlanets.

Most of my confusion comes from using helper functions and splitting everything between the two files. I can make it work without the helper functions and such, but that’s not what the assignment asks.

So I just got it to pass. For your pick planet function, you almost have it. I did this:
:flushed:removed screenshot

And then for your Script.js the addDestinationInfo(document part is fine, but you’ll need to pull in the rest of the parameters from the function in scriptHelper such as name, diameter, etc. Kind of like when you did your formSubmission one

Ok, so I fixed my pickPlanet function, but I’m still a little stuck. This is what I’ve done so far.
:pouting_cat: removed more screenshots

The rest of my code works fine until I add the required statement, and then nothing works anymore.

I had something similar to yours at first. You shouldn’t need that var statement or the let pickedPlanet one. Try taking those out and then setting your parameters to, etc. Also, I used window.document. All of this should be after the 2nd console.log… if that makes sense

When I try, planets.diameter, etc. I get an uncaught reference error: planets not defined.

I assume because I still need to call pickPlanet() somewhere.

Is there something wrong with my fetch function?

:raised_hand: :raised_hand: if you have a question about your solution code, try explaining it to us

I don’t have the response.json().then or the console part. I just let it return response.json(). It’s a function so it should in theory return something.