Tell us what is happening:
Your code so far
function buyWeapon() {
let newWeapon;
if (gold >= 30) {
gold -= 30;
currentWeapon++;
let newWeapon = "weapons";
goldText.innerText = gold;
text.innerText = "You now have a new weapon.";
}
}
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 88