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

Tell us what’s happening:

How do we call a lose function in step 126 if we haven’t created a lose function?

Your code so far

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

/* file: styles.css */

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

function attack() {if (health<= 0) 
  text.innerText = "The " + monsters[fighting].name + " attacks.";
  text.innerText += " You attack it with your " + weapons[currentWeapon].name + ".";
  health -= monsters[fighting].level;
  monsterHealth -= weapons[currentWeapon].power + Math.floor(Math.random() * xp) + 1;
  healthText.innerText = health;
  monsterHealthText.innerText = 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/125.0.0.0 Safari/537.36 Edg/125.0.0.0

Challenge Information:

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

you will create it soon, meanwhile you call the lose function like any other function

@freddok2g4 I just made it to this step. If you are still stuck here, reset it and you will notice at the bottom of the highlighted code and empty line near the bottom. Try placing the instructed code there. :+1: