Step 61 - Learn Basic JavaScript by Building a Role Playing Game

Hi,
This is the link to step 61 https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-javascript-by-building-a-role-playing-game/step-61

“You now need to pass the location argument into the update call. You pass arguments by including them within the parentheses of the function call. For example, calling myFunction with an arg argument would look like:”

myFunction(arg)

“Pass your locations array into the update call.”

If I need to pass the parameter of the function that is location to the update() function (from Step 50), why is it asked here to put as parameter the variable locations ?

here you are putting the argument that gives the value to the parameter

like

function myFunc(number) {
   console.log(number)
}

this function wants to print something to the console but it can’t without knowing the value, and that happens when you call the value with an argument

myFunc(3);
myFunc(-987);
myFunc(0);

I am confused with this step. I don’t know what to put as my code.

reset the step, notice that the starting code is

function goTown() {
  update();
}

now you need to give an argument to update following the instructions

Pass your locations array into the update call.

1 Like

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