Calling a Function - Step 135 building a role playing game

Hello, I need some clarification - I had finally passed this step of the challenge but I am a little confused on my error.

This is the instructions:
At the end of your code, 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.

Also update the innerText properties of goldText, healthText, and xpText to their current values.

Finally, call the goTown() function.

MY code (I eliminated the first portion of my code so that I am not posting the solution.):

function restart() {
xpText.innerText = xp;
function goTown() {
}
}

My confusion is on the part where it is asked to call the goTown function. I am confused why I must code it as “function goTown ()” rather than just “goTown()” since it has already been declared in previous steps.

Hi! You should just use goTown()

Hi, so my previous code used goTown() but it was not accepting it until I added function so that is why I am confused or if there is something I am missing in my thought process

That is weird. Maybe a bug in the auto test check.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.