Strugging to complete challange
what is wrong with my array assignment
Instructions : create a restart
function. Inside this function, set xp
to 0
, health
to 100
, gold
to 50
, currentWeapon
to 0
, and set inventory
to an array with the string stick
.
MY CODE SO FAR
function restart(){
xp = 0;
health = 100;
gold = 50;
currentWeapon = 0;
inventory[0] = "stick";
goldText.innerText = gold;
healthText.innerText = health;
xpText.innerText = xp;
goTown();
}
ERROR : Your restart
function should set inventory
to an array with the string "stick"
.
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 135