Tell us what’s happening: I’m stuck but I’m sure I have the right code…?
Your code so far
function attack() {
text.innerText = "The " + monsters[fighting].name + " attacks.";
text.innerText = " You attack it with your " + weapons[currentWeapon].name + ".";
}
### Your browser information:
User Agent is: <code>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36</code>
### Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 119
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-javascript-by-building-a-role-playing-game/step-119
function attack() {
text.innerText = "The " + monsters[fighting].name + " attacks.";
text.innerText = " You attack it with your " + weapons[currentWeapon].name + ".";
}