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

Tell us what’s happening:

I’m following instructions but still it’s throwing error

Your code so far

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

/* file: styles.css */

/* file: script.js */
// User Editable Region
// instructions 
/*Add another object to your locations array. Set name to "easter egg", set "button text" to an array with the strings "2", "8", and "Go to town square?", set "button functions" to an array with the variables pickTwo, pickEight, and goTown, and text to "You find a secret game. Pick a number above. Ten numbers will be randomly chosen between 0 and 10. If the number you choose matches one of the random numbers, you win!"*/

{ 
  name: "easter egg",
  "button Text": ["2", "8", "Go to town square?"],
  "button Functions": [pickTwo, pickEight, goTown],
  text: "You find a secret game. Pick a number above. Ten numbers will be randomly chosen between 0 and 10. If the number you choose matches one of the random numbers, you win!" 
}

// 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/124.0.0.0 Safari/537.36

Challenge Information:

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

what error are you getting?

it’s not passing my code

I imagine that is why you are asking for help, yes
what error are you getting?

yup, I followed given instruction but it’s not passing my code

Error Statement:
Your eighth locations value should have a "button text" array with the strings "2" , "8" , and "Go to town square?" .

The keys for the object are button text and button functions, not button Text and button Functions.

1 Like

Thanks you so much, Toan

1 Like