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:) :((
6,776 PointsPlease help i dont see the error on the challange :(
I know its something stupid but i dont see it please help
const player1 = {
name:"Mark",
color:"Red",
isTurn: true ,
play() : function()
}
1 Answer
Ignacio Rocha
7,462 PointsFirst of all is not stupid, everyone sometime has little mistakes is all part of the learning process.
your code is almost perfect, your mistake is in the play function: when you declare a function inside an object literal you have to declare the function with parentheses and curly brackets like so:
const player1 = {
name:"Mark",
color:"Red",
isTurn: true ,
play: function() { }
}
Steven Parker
231,184 PointsSteven Parker
231,184 PointsYou could also use the more compact "arrow" syntax:
play: () => {}
:) :((
6,776 Points:) :((
6,776 PointsThanksss