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

Hi i have been struggling with this step. Here is the question:

Step 65
location["button text"] is an array with three elements. Change the button1.innerText assignment to be the first element of that array instead.

function update(location) {
  button1.innerText = location["button text"];
  button2.innerText = "Go to cave";
  button3.innerText = "Fight dragon";
  button1.onclick = goStore;
  button2.onclick = goCave;
  button3.onclick = fightDragon;
  text.innerText = "You are in the town square. You see a sign that says \"Store\".";
1 Like

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

put a [0] after it and it should work

1 Like

thank you very much! :slight_smile:

its not still not working, is it working for you?

location[“button text”][0]; this will work

1 Like