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 trialMasha Ivy
53 Pointshow do I see the right answer ?
I don't know what i'm asked to do and what i'm doing wrong
const player1 = {
name: 'Ashley',
color: 'purple',
isTurn: true,
play: function(){
if (player1.isTurn == true) {
}
}
1 Answer
<noob />
17,062 PointsHello. you’re being asked to check if inside the player object the property “isTurn” is equal to true. You are very close to the answer. in order to access the properties in the same object u need to use the keyword “this”. “this” refers to the current object which is player1. so to access the isTrue property inside a function in an object u need to do: if(this.isTurn === true)