Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
- What Happens Next? 1:29
- Build the mark() Method
- Build the checkForWin() Method
- get owner() Solution
- checkForWin() Method Challenge Solution
- Build the switchPlayers() Method
- Build the gameOver() Method
- Game Logic Methods Solution 1:56
- Build the updateGameState() Method
- Callback Function Solution
- updateGameState() Method Solution 2:16
- Reviewing 'Adding the Game Logic' 4 questions
Well done!
You have completed Object-Oriented JavaScript: Challenge!
Instruction
get owner() Solution
get owner() Solution
Here is the solution for the owner getter method in the Space.js file
/**
* Checks if space has an associated token to find its owner
* @return {(null|Object)} Returns null or the owner object of the space's associated token.
*/
get owner() {
if (this.token === null) {
return null;
} else {
return this.token.owner...