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 Object-Oriented JavaScript: Challenge Rendering the Game startGame() Method Solution

Thu Yein
seal-mask
PLUS
.a{fill-rule:evenodd;}techdegree seal-36
Thu Yein
Full Stack JavaScript Techdegree Graduate 30,261 Points

Token is not being displayed, but everything else is fine. Any possible solution to this problem?

I have triple checked my code and all my spelling. I believe it may have something to do with the get htmlToken() { return document.getElementById(this.id); } I'm not sure where this getter method would be called from, as it did not state in the instructions.

2 Answers

Try doing this for the htmlToken getter method:

get htmlToken(){
    return this.drawHTMLtoken;
};
Thu Yein
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Thu Yein
Full Stack JavaScript Techdegree Graduate 30,261 Points

Ok, so i've tried that as well, still no luck. What doesn't make sense to me is that the htmlToken getter method is not being called anywhere in the project.

Hmm, I'm not sure. There is the solution in the folder that you downloaded so you can open that in your editor and compare your code to that one.

Khashayar Mirbabaie Ghane
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Khashayar Mirbabaie Ghane
Full Stack JavaScript Techdegree Graduate 27,891 Points

Hey Thu Yein if your game runs and there are no errors ,its just you don't see your token on the top left of the boarder then maybe this helps you , I had exactly the same issue and there were no errors . at game.js file in the createPlayers() inside the array make sure player1 color is exactly '#e15258' , I was missing the 'e' and when I noticed it ,now I can see the token . hopefully this helped you. remember as I said if there are no errors and you just don't see your token.