/* file: script.js */
// User Editable Region
function attack() {
text.innerText = "The " + monsters[fighting].name + " attacks.";
text.innerText+= " You attack it with your" + weapons[currentWeapon].name + ".";
}
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 118
Hi JeremyLT, on step 118 -
function attack() {
text.innerText = “The " + monsters[fighting].name + " attacks.”; text.innerText+= " You attack it with your" + weapons[currentWeapon].name + “.”;
}
I wrote the above line of code(in bold) as per the instructions. But I kept getting error that it wasn’t right. However, it worked a bit later - with the same line of code. I didn’t change it. But it worked.