sorry about the poor formatting of my question, i am new to Replit.
this tutorial generates this error when run: ReferenceError: restart is not defined
however it seem to be defined in this array:
const locations = [
{
name: "lose",
"button functions":[restart, restart, restart],
"button text": ["REPLAY ?", "REPLAY ?", "REPLAY ?"],
text: "You die. "
}
]
and the function is
function restart() {
xp = 0;
health = 100;
gold = 50;
currentWeapon = 0;
inventory = ["stick"];
goldText.innerText = gold;
healthText.innerText = health;
xpText.innerText = xp;
goTown();
}
also in function restart()
the function name - restart has squiggle lines underneath and when hovered over states:
restart
is declared but its value is never read.
i have tried to be sure that this code, is type in the same as the tutorial but i don’t see any differences that would cause the runtime error i’m getting.
suggestions would be appreciated, thanks