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 Object Basics Filling Out the Play Method

Nermin Kekic
Nermin Kekic
6,971 Points

Need help with this challenge?

Hey guys i am stuck with this challenge, and i cant understand why its not letting me pass. I think i have every thing that its asking me here, which is, to test if isTurn property is true using "this" and "dot" notation.

const player1 = {
    name: 'Ashley',
    color: 'purple',
    isTurn: true,
    play: function(){
        // write code here.
        if (this.iSTurn) {

        };
    }
}
Nermin Kekic
Nermin Kekic
6,971 Points

I am not sure what happen, i refreshed my browser and retyped the same exact if statement as above and it worked...

2 Answers

Balazs Peak
Balazs Peak
46,160 Points

You have just made a typo (iSTurn with big s). Over time, you'll be more able to pay attention to small details, which is crucial for programming but you have to get used to it.

if(this.isTurn){}
Nermin Kekic
Nermin Kekic
6,971 Points

Ahh i see. Thank you, its so easy to over look something like this.

Balazs Peak
Balazs Peak
46,160 Points

You will become better and better at it. :) Just keep practicing always, even if you have 10 minutes a day, keep practicing. You can slow down, but never stop - that is my advice.