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

Tell us what’s happening:

I need help guys please help me solve this challange

Your code so far

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

/* file: styles.css */

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

function goFight() {
  update(locations[3]);
  monsters[fighting].name = monsterHealth
  

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

Challenge Information:

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

Don’t forget to talk about how you are stuck. Communication is a critical job skill for programming

Hi @Benyxel

The order of the code is not correct. Try swapping them to the other side of the equals sign.

Also, your code is access the name property.

Happy coding

You’re currently assigning the name of the monster to its health. You should be assigning the monsters[fighting].health to monsterHealth instead.
Hope this helps!