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

Tell us what’s happening:

Very unsure what I’m doing wrong here, says I am not using the concatenation operators however I have them and I have the spaces before and after each word.

Your code so far

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

/* file: styles.css */

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

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

// 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/126.0.0.0 Safari/537.36

Challenge Information:

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

i think the array is called monsters not monster

1 Like

Yeah…The name of your variable is supposed to monsters. Sometimes it can be confusing while learning and we start making minor mistakes that make it even more frustrating but keep on moving on. You get used to it and eventually it becomes fun and easier . :blush:

1 Like