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

Tell us what’s happening:

Hi all…could someone assist.
I keep getting " Your locations array should have two values".
I am not sure what I am missing.

  {
    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: "Go to store",
    "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\"."
  }
]; ```

### Your code so far


```html
<!-- file: index.html -->

/* file: script.js */
// User Editable Region

const locations = [
  {
    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: "Go to store",
    "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\"."
  }
];

// User Editable Region
/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/20100101 Firefox/129.0

Challenge Information:

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

Hi,
Your code seems perfect. However, there’s a small thing you missed.

store should be wrapped around quotation marks here. And also, you should add the second object after the first one. It says your second object should have a name property equal to store. Hope this helps and good luck!

1 Like