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 trialAleksandar Dimovski
45,031 PointsJS 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
27,692 PointsThink 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;
};
Aleksandar Dimovski
45,031 PointsAleksandar Dimovski
45,031 PointsThanks for clearing that up.. :D