Java-Script Learn Basic JavaScript by Building a Role Playing Game Step 80

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-javascript-by-building-a-role-playing-game/step-80

Just like your locations array, your weapons array will hold objects. Add four objects to the weapons array, each with two properties: name and power . The first should have the name set to "stick" and the power set to 5 . The second should be "dagger" and 30 . The third, "claw hammer" and 50 . The fourth, "sword" and 100 .

it tells me that their is something wrong but it doesnt tell me what can someone tell me

here is my code

const weapons = [
  {
    name= "stick",
    power= "5"
  },
  {
    name= "dagger",
    power= "30"
  },
  {
    name= "claw hammer",
    power= "50"
  },
  {
    name= "sword",
    power= "100"
  }
];

You are using the incorrect syntax for objects here

look back at the objects you created earlier

  {
    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\"."
  },

Can you spot the syntax differences?

Once you fix the syntax issues, then you will be able to run the tests

Your almost there the numbers dont go inside quote and you calling a object look at your previews line on top and see what is different from your. other this code.

omg thank both of yall it was just a small error i coudnt see

2 Likes

The problem is you are using = instead of the dot notation

heres the right code

Mod Edit SOLUTION REMOVED

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

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