Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Object-Oriented JavaScript Object Basics Creating Object Literals

I can't find an object literal called Play()

I can't figure this out I've watched the intro again and again and I still don't know how to pass it . Is there someone who can help me?

object.js
const player1 = {
name: ' ha',
  color: 'no',
  isTurn: true,
  confused: play(){}

}

1 Answer

Steven Parker
Steven Parker
218,815 Points

The challenge says "Add an empty method to the object literal called play()." But this code is adding something named "confused" instead.

At 2:07 in the Object-Oriented JavaScript video, you'll see an example of a method named bark() added to an object literal. What you need for the challenge is very similar other than yours will have a different name and empty contents (nothing between the braces).