Learn Basic JavaScript by Building a Role Playing Game - Step 117

Tell us what’s happening:

my code is not going through i put the right answer

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

function attack() {
        text.innerText = "The " + monsters[fighting].name + "attacks.";
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15

Challenge Information:

Learn Basic JavaScript by Building a Role Playing Game - Step 117

You have spacing issues.
That is why it is not passing.

Modify your code to include this function call and reassignment for the fighting variable so you can see for yourself what the issue is

function attack() {
        text.innerText = "The " + monsters[fighting].name + "attacks.";

}
fighting=1
attack()

look in the preview window to the see the spacing issue

then once you fix the issue, you can remove this code here, since that is just for testing purposes

fighting=1
attack()

thanks i got it have a blessed day!

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