comments within the JS code highlight where I’ve messed with code/tried to locate problems/solutions.
My apologies in advance, only coding for 3 days, definitely into a project that I don’t have the requisite knowledge for.
Trying to display contents of an Inventory array (myInventory variable) inside of a const textObject set up that holds informaton about the current image/audio/story text and options the player can choose.
Thank you in advance for any help you can offer!
Wow! This is really good for you only coding for three days!
If you want to add an item to an inventory variable, try doing something like
inventory.push(new_item) where ‘inventory’ is the array variable and ‘new_item’ is the value that you will add.
if you want to display the inventory variable in HTML, do something like
[element].innerHTML = inventory. the [element] can be a
Hope that helped!
Thank you so much!
I’ll clean it up and make another attempt!