Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- Preparing to Build the Classes 0:34
- Practice Brainstorming Properties
- Player Properties Solution 2:57
- Token Properties Brainstorming
- Token Properties Solution 2:33
- Build the createTokens() Method
- createTokens() Method Solution 3:06
- Board and Space Class Constructor Methods
- Board and Space Class Constructor Methods Solution 3:58
- Build the createSpaces() Method
- createSpaces() Method Solution 2:46
- Game Class Constructor Method
- Game Class Constructor Method Solution 2:45
- Reviewing Constructor Methods and Generating Objects 5 questions
Well done!
You have completed Object-Oriented JavaScript: Challenge!

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
See the solution for the properties that will be used in the Token Class.
Code Correction
The project files for this stage are correct, but what you see on screen is missing something! Can you tell what it is?
I forgot to add in the parameters in the constructor method for index
and owner
.
The correct code for the constructor method is:
class Token {
constructor(index, owner){
this.owner = owner;
this.id = `token-${index}-${owner.id}`;
this.dropped = false;
}
}
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Crystal Vesely
14,503 Points1 Answer
-
Ryan Wikle
5,774 Points1 Answer
-
Ming Jhang Chen
6,709 Points2 Answers
-
PLUS
Harris Keka
Courses Plus Student 3,611 Points1 Answer
-
Hamzah Iqbal
Full Stack JavaScript Techdegree Student 11,145 Points1 Answer
-
Michael Cook
Full Stack JavaScript Techdegree Graduate 28,975 Points1 Answer
-
Ashish S
Python Web Development Techdegree Student 938 Points1 Answer
-
Richard Eldridge
8,229 Points4 Answers
-
PLUS
Gonzalo Torres del Fierro
Courses Plus Student 16,751 Points0 Answers
-
MOD
Jonathan Grieve
Treehouse Moderator 91,254 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up