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

Tell us what’s happening:

I’ve done everything I could try, I searched, I read, I even reset.ed the step step but it still doesn’t let me pass, someone tell me what I did wrong…

Your code so far

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

/* file: styles.css */

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

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

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0

Challenge Information:

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

Hi there!
Did you check the error info?

SyntaxError: unknown: Invalid shorthand property initializer. (21:9)

  19 | const weapons = [
  20 |   {
> 21 |     name = "stick",
     |          ^
  22 |     power = 5
  23 |     },
  24 |   {

You forgot to read about not using = when working with objects :grin:
Good luck!

Ahh I see it now, thank you so much!

1 Like

I just realized I used those, thank you for the help!

1 Like