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

Tell us what’s happening:

It says that I should assign monsters[fighting].name to monsterName.innerText, although I thought I did that?

Your code so far

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

/* file: styles.css */

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

function goFight() {
  update(locations[3]);
  monsterHealth = monsters[fighting].health;
  monsterStats.style.display = "block";
  monsters[fighting].name = monsterName.innerText;
  monsterHealth = monsterHealthText.innerText;
}

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

Challenge Information:

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

what you have here is an assignment of monsterName.innerText to monsters[fighting].name

So the thing that is changing is the thing on the left.
This is not what they want to change.

Thanks, feels like a trick sentence.

yeah I agree it is tricky for someone who is learning. Always try to double check what is going where. The place it is going (like “to something”) is always on the left of the equals.

1 Like

How did you figure it out?

hi there!
if you have any question about specific curriculum challenges, create your own topic to the challenge step using Help button. that button appear below the challenge editor, when you try to submit the wrong code more than three times.