Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Introducing JavaScript Finishing the Game Wrapping It Up

Adding life counter

I'm trying to add a life counter and have made changes in my code for it but it seems like there is something wrong with my code. When I try to preview it nothing comes up.s

4 Answers

If you check the console you'll see 'Uncaught SyntaxError: Unexpected end of input' at the end of your code. Working backwards you'll find a closing bracket is missing.

    } else if (won) {
      winningMessage.text = "YOU WIN!!!";
    }
  } //<--- add this bracket

  function render() {

  }

};
diogorferreira
diogorferreira
19,363 Points

Could you send us the code so we can try help?

It worked. Thanks a lot for the help. :)