Tell us what’s happening:
Hello,
Can someone explain to me what “xp” is, in the answer to this question? I understand most of the code, but I assumed xp would be a variable, but we never declared a variable called “xp” anywhere else in the code, so I’m not sure what it means, or what exactly it’s function is in the code.
Thank you!
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
monsterHealth -= weapons[currentWeaponIndex].power;
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 124