Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
- 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!
Instruction
Build the createTokens() Method
Assignment:
Inside the Player class, write a method called createTokens() using the guidelines and requirements below.
In the Player class constructor method, change the value of the tokens property from an empty array to a call to the createTokens() method.
When you call the createTokens() method pass in the integer 21, for the number of tokens to be created.
The "Why"
The Player object...