Learn Basic JavaScript By Building a Role Playing Game - Step 96

pls i have this issue too and i’ve checked everything…

if (currentWeapon < 3) {
  if (gold >= 30) {
    gold -= 30;
    currentWeapon++;
    goldText.innerText = gold;
    let newWeapon = weapons[currentWeapon].name;
    text.innerText = "You now have a " + newWeapon + ".";
    inventory.push(newWeapon);
    text.innerText += " In your inventory you have: " + inventory;
    } else {
    text.innerText = "You do not have enough gold to buy a weapon.";
  }
  }

hey @creativictor97

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

its showing this console output:

[TypeError: Cannot read properties of undefined (reading ‘name’)]

as you are not creating your own topic, I am moving the posts manually to a new topic, please create your own topic to ask questions

this is the step

I don’t see this in the console, can you share all the code?

i created a new post

access it here: Learn Basic JavaScript by Building a Role Playing Game - Step 96 - JavaScript - The freeCodeCamp Forum

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.