In the solution to this step of building the role playing game I have:
function attack() {
text.innerText = "The " + monsters[fighting].name + " attacks.";
text.innerText += "You attack it with your " + inventory[currentWeapon] + ".";
}
and it doesn’t pass. I’ve also tried:
function attack() {
text.innerText = "The " + monsters[fighting].name + " attacks.";
text.innerText += "You attack it with your " + weapons[currentWeapon].name + ".";
}
I don’t know if the method i’m using to get the player’s current weapon is the problem. The hint given when I fail this is not very helpful. Please help me. I’m stuck.