Learn-basic-javascript-by-building-a-role-playing-game - Step 131

Hey guys so this step wants me to add a new object and the end of the locations array. I have done that, but when I try to check code it comes up with nothing, no error code and it most certainly does not say I have completed the step. Any assistance is appreciated.


please post your code, not a screenshot. It looks like you have a syntax error, but it’s impossible to point it out to you like this

Here is the whole code! Apologies in advance this is my first time posting.

const locations = [
  {
    name: "town square",
    "button text": ["Go to store", "Go to cave", "Fight dragon"],
    "button functions": [goStore, goCave, fightDragon],
    text: "You are in the town square. You see a sign that says \"Store\"."
  },
  {
    name: "store",
    "button text": ["Buy 10 health (10 gold)", "Buy weapon (30 gold)", "Go to town square"],
    "button functions": [buyHealth, buyWeapon, goTown],
    text: "You enter the store."
  },
  {
    name: "cave",
    "button text": ["Fight slime", "Fight fanged beast", "Go to town square"],
    "button functions": [fightSlime, fightBeast, goTown],
    text: "You enter the cave. You see some monsters."
  },
  {
    name: "fight",
    "button text": ["Attack", "Dodge", "Run"],
    "button functions": [attack, dodge, goTown],
    text: "You are fighting a monster."
  }, 
  {
     name: "kill monster",
    "button text": ["Go to town square", "Go to town square", "Go to town square"],
    "button functions": [goTown, goTown, goTown],
    text: "The monster screams Arg! as it dies. You gain experience points and find gold."
  },
  {
  // Step 131
    name: "kill monster",
    "button text": ["Go to town square", "Go to town square", "Go to town square"],
    "button functions": [goTown, goTown, goTown],
    text: "The monster screams Arg! as it dies. You gain experience points and find gold."
  }

I mean the WHOLE code, all you have in the editor.

Looking at what you posted, one thing come to mind. Did you close the locations array?

The locations array was not closed, thank you. Now it is throwing " Your locations array should have five values." Which still leaves me puzzled. I thought I added the fifth value as you can see in my last reply.

It has 6 values in it, you have a duplicate

Oh my goodness. I am so sorry for this idiotic post. Thank you for your assistance.

1 Like

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