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

Tim Hare
seal-mask
.a{fill-rule:evenodd;}techdegree
Tim Hare
Full Stack JavaScript Techdegree Student 14,525 Points

inside the play method, write an empty if statement that checks if its the players turn. use dot notation.

I have no idea what the question is asking me. I have yet to use if statements and I do not know how to use dot notation.

object.js
const player1 = {
    name: 'Ashley',
    color: 'purple',
    isTurn: true,
    play: function(){
        // write code here.
    }
}

2 Answers

Steven Parker
Steven Parker
231,184 Points

This is an intermediate-level course, and it has two specific prerequisites: JavaScript Basics and JavaScript Loops, Arrays, and Objects.

You might set this course aside until you have completed both of those, and then come back to this one armed with essential knowledge such as how to use "if" statements.

andren
andren
28,558 Points

If that is the case then you must not have completed the JavaScript Basics and JavaScript Loops, Arrays and Objects courses.

They are both classified as prerequisite courses for the Object-Oriented JavaScript course. Which means that it is recommended that you complete them before starting the course you are currently on, unless you are already familiar with the concepts thought in those courses.

Also the video that directly precedes this challenge Dot Notation & Bracket Notation does offer a refresher on what dot notation and bracket notation are. So unless you skipped that video you should be familiar with how dot notation works.