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 Adding the Game Logic Reviewing 'Adding the Game Logic'

Aleksandar Dimovski
Aleksandar Dimovski
45,031 Points

JS Mark method

The mark() method is available on the ____ class

im trying to find the answer on the videos but i have no luck so can any one help me with this questions ?

Thanks

1 Answer

Camilo Lucero
Camilo Lucero
27,692 Points

Think of what the mark method does:

/**
 * Updates space to reflect a token has been dropped into it.
 * @param {Object} token - The dropped token
 */

So you give it a Token object as an argument and it will fill the Space object, token property with that Token, so what it basically does is:

Space.token = Token;

Therefore, the best place to write that method is inside the Space class, so that we can write it like this:

mark(token) {
  this.token = token;
};