Learn Basic Javascript Step 57

I’ve written the code correctly as the instructions ask. However, when I try to check my code the application doesn’t want to authorize or give me errors to check. Very overwhelmed with this new change.

Maybe the problem is your code, in the other curriculum, this often happens when you have mistakes in your code, the lesson works perfectly on my end.

1 Like

Can you share the code you tried?

2 Likes

Create another property in your object called button functions .

Give this property an array containing the three functions assigned to the onclick properties in the goTown function.

Remember that these functions are variables, not strings, and should not be wrapped in quotes.

I know for certain I’ve written this code correctly but the “check code” button doesn’t work even to the point it should give me an error to write the correct syntax. Before proceeding I went to step 58 just to make sure for sanity’s sake that I did do it correctly.


const locations = [
    {
        name: "town square",
        "button text": ["Go to store", "Go to cave", "Fight dragon"]
        "button functions": [goStore, goCave, fightDragon] <------- The new line of code
    }
];

Try opening the console, it will give you more information about analyzing your code.

Also, keep in mind that you need commas separating each object element. name: "town square", has a comma after it, for example.

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