The check your code button isn't working

Hi, I’m on the first javascript lesson on step 138, I think I’ve completed this step but I can’t move forward the button for submitting my code isn’t working so I’m stuck, this has happened to me like 5 times during this lesson and usually there would be something wrong with my code like missing a comma or a semi-colon when i fix it the button works again, but I’ve checked I don’t see anything missing.

Here’s the step’s intructors:

In the locations array, add another object at the end. Set the name property to lose , set button text to an array with three REPLAY? strings, set button functions to an array with three restart variables, and set text to You die. ☠️ . You can copy that text to use the emote.

here’s the locations array code:

const locations = [
    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\"."
    name: "store",
    "button text": ["Buy 10 health (10 gold)", "Buy weapon (30 gold)", "Go to town square"],
    "button functions": [buyHealth, buyWeapon, goTown],
    text: "You enter the store."
    name: "cave",
    "button text": ["Fight slime", "Fight fanged beast", "Go to town square"],
    "button functions": [fightSlime, fightBeast, goTown],
    text: "You enter the cave. You see some monsters."
    name: "fight",
    "button text": ["Attack", "Dodge", "Run"],
    "button functions": [attack, dodge, goTown],
    text: "You are fighting a monster."
    name: "kill monster",
    "button text": ["Go to town square", "Go to town square", "Go to town square"],
    "button functions": [goTown, goTown, goTown],
    text: 'The monster screams "Arg!" as it dies. You gain experience points and find gold.'
    name: "lose",
    "button text": ["REPLAY?","REPLAY?","REPLAY?"],
    "button functions": [restart,restart,restart],
    text= "You die. ☠️"

Your browser information:

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

Challenge Information:

Personal Portfolio Webpage - Build a Personal Portfolio Webpage

This line is a syntax error - you don’t set values in an object literal with =

Oh I didn’t notice I had an = sign, but why is it when there’s something wrong with my code I can’t press the check you code button, usually if there’s something wrong and I press the button they would tell me where the error was.

If its too big of a syntax error, then the check code button can’t work. I’m not sure if we have plans for a way around that limitation right now.

I was also stuck on step 59 of the same lesson with the same issue - “Check Your Code” just wasn’t doing anything. Even when I intentionally broke my code, the test-feedback div was not appearing at all, so there was no indication on whether or not my code was correct or how to move forward. I was only able to see it when inspecting the element with dev tools (and finally discovered it was a syntax error).

1 Like

hey @jqi

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

And here lies part of the problem. If the «Check your code» button isn’t working, it will never trigger the «Ask for help» button. It won’t give you any context clues and you won’t be able to proceed until you’ve figured out what’s wrong without the tiny tips you’d get when the button is actually working.

If the Check your code button is not working there is a syntax error that breaks things. If the button is not present, clear your cache. You can also open a Topic directly without using the button, but providing at minimum your code and the challenge link