Tell us what’s happening:
Add the string " In your inventory you have: " - include the spaces at the beginning and the end.
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
function buyWeapon() {
if (gold >= 30) {
gold -= 30;
currentWeaponIndex++;
goldText.innerText = gold;
text.innerText += " In your inventory you have: <br>";
let newWeapon = weapons[currentWeaponIndex].name;
inventory.push(newWeapon);
// User Editable Region
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 92