@tkressma
Posted
Hey Jesse, good job.
I HIGHLY recommend you put your script in a seperate file (E.G. script.js) then import it at the end of your body - or, at the very beginning of the body tag using defer.
Similar to what Haybuka said, you first need to "fill" your localStorage with an item before trying to access it. You would want to do this upon successfully fetching some data from the API. You can do this by writing localStorage.setItem('<some name resembling the url data>', <the object recieved from the api call>). Then, when you want to retrieve the localStorage data, you would write localStorage.getItem('<name you decided on calling the item'>).
Check out more about localStorage on the docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
@jesseburn
Posted
@tkressma thank you for your input! I will try that out!