-1

I am having some troubles. We had an assignment in the JavaScript class that I am taking to create a game of Hangman using module pattern.

I have succeeded with making it function, however, my code does not pass the Jslint validation test. It keeps giving me one error and I have no idea how to get rid of it.

Read below what it says. hangman.js: line 221, col 30, Expected an assignment or function call and instead saw an expression.

I have tried to remove everything on line 221 but then my code does not work anymore. Please help me.

line 221 hangman.wrongCount = 0;

Here is a link to a fiddle in which I have put all my code. And note, it is ONLY line 221 in the javascript that is creating problem, the rest you can ignore.

Link to fiddle: http://jsfiddle.net/1nvaahyv/

Thanks in advance!

Jeremy W
  • 1,889
  • 6
  • 29
  • 37
BjornRunow
  • 525
  • 1
  • 4
  • 10
  • Line 220 (just before the error you're seeing) ends with a comma, when it looks like it should end with a semicolon instead. Might that be causing JSLint to flag an error? I'm still not sure why it's looking for a function call, though. – The Spooniest May 29 '15 at 15:43
  • Wow, it is amazing how I can have missed that!! I have gone through the code so many times – BjornRunow May 29 '15 at 15:52

1 Answers1

4

The problem lies in the preceding line (note the comma):

    hangman.guessedLetters = [],
    hangman.wrongCount = 0;
musically_ut
  • 34,028
  • 8
  • 94
  • 106