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

Tell us what’s happening:

I don’t know what is wrong with my code, I tried several times, please assist.

Your code so far

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

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

function restart() {
  xp = 0;
  health = 100;
  gold = 50;
  currentWeaponIndex = 0;
  inventory = ["stick"];
  goldText.innerText = gold;
  healthText.innerText = health;
  xpText.innertext = xp;
  function goTown();
}

 
 




// User Editable Region
/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Avast/130.0.0.0

Challenge Information:

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

Hi there!

Correct the latter casing in above line.

You need to call the function above. Calling a function didn’t need the function keyword.

Thank you, it worked.

1 Like