Hangman Game Course cannot be completed! Please help!


<Below this line, add a link to the EXACT exercise that you are stuck at.>

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
Oops, try again. Make sure you have defined all the variables!


// This array holds the words we are going to choose from.
// Feel free to add new words!
var words = [‘cat’, ‘tree’, ‘swing’, ‘around’, ‘scientist’];

// This function will pick our word
function chooseWord () {
// Write code here
return words[Math.floor(Math.random() * words.length)];

<do not remove the three backticks above>

Hi guys,

i know that this is a non-track course, but i want to complete this course at 100%, i'm stuck at 81%, because i can not complete four first exercises. My code does not pass the validation check and all the time I get the same error message on the screen "**Oops, try again. Make sure you have defined all the variables!**". This applies to the first four exercises: **Rules of the Road**, **Blanks for your Answer**, **Replacing a Letter**, **Guess a Letter, Any Letter!**.

I tried to find a solution on the forum [Hangman Game Forum](https://www.codecademy.com/en/forums/javascript-intermediate-tpoPb), but did not find anything useful, that would help me to solve this problem... On the profiles of some of the forum members, I noticed that they have somehow completed this course, because they have received the **course completion badge for Hangman Game**.

I appeal to the guys who have dealt with this course and finished it completely. I would be happy for your help and assistance in this matter.


Simple error :sweat_smile:

All you need to do is pass words as a parameter and you should pass,

// This function will pick our word
function chooseWord (words) {

Thank you, but it does not change anything! The error still exists…

So your code looks like this now?


yes, exactly!

Refresh the page and the rewrite this line,

return words[Math.floor(Math.random() * words.length)];

Sorry, but this does not work too…

I don’t know what’s the problem. Your code is correct.
From instruction:

In function chooseWord() create a function that takes the words array and then returns a random element of the array.

Instruction says create a function in function. I can’t understand what it means.
Also I tried your code in Chrome and it works.


thanks for your reply!

This means that it does not work for this exercises: [quote=“markkarnaukh, post:1, topic:61564”]
Rules of the Road, Blanks for your Answer, Replacing a Letter, Guess a Letter, Any Letter!.

Regardless of what I tried to do, I keep getting the same error message!

For example here:

Hi all again,

who has more ideas for solutions to this problem? Does someone have any ideas at all?

I noticed a strange thing:

Everyone who got this badge, completed this course in 2012-2013.Could it be that the reason is the version of the browser? Is it even possible to complete this course in general, if i will try to use an older version of the browser?

I would be grateful to anyone who can help to shed light on the issue!


Think you must be right, the code I have already passed with is not passing the exercise anymore.
I can’t figure out a workaround either, sorry! Your code is of course correct though.

1 Like

Doesn’t work in FF or Chrome. The SCT is broken. We will need someone who knows how to create workarounds. Suggest invite @ionatan and @appylpye.

1 Like

Where is that text coming from?
"Make sure you have defined all the variables!"
It’s not in the submission test and I don’t see it in the page source either, but I’m not at all good at digging through that

I couldn’t find it either, but then that’s nothing new.

It is also possible to try downgrading of the browser version as last resort:

Google Chrome:

Mozilla Firefox:


Release history:

Is that more than just speculation?

Anyway, I passed it by other means:


Add a breakpoint where the console reports an error and switch out the error value with undefined
…editing it allows for clicking through the whole thing :innocent:

1 Like

Hello Jonatan,

it’s amazing and unbelievable! :smile: I don’t know how to express my gratitute towards you for your help! This is truly great! :slight_smile:

I’m not too familiar with the developer tools, it can be said that I am an noob… Could you please tell me step by step what I need to do? It will be for me as a good opportunity to see how it works.

Thanks a lot,

That pretty much was step by step, there weren’t very many of them. Run the exercise and follow the exception that’s reported in the console

Finally it happened!!!

@ionatan , may god grant you health, you are a lucid mind!! :slight_smile:
@mtf, @alexcraig: Thanks for your help and assistance! Have a nice day! :wink:

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