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.

Brian Johnson
Front End Web Development Techdegree Graduate 20,806 PointsHow is my string wrong? I need some assistance please
Please help
const player1 = {
name: 'Ashley',
color: 'purple',
isTurn: true,
play: function(){
if (this.isTurn){
return['name'] + 'is now playing!';
}// write code here.
}
}
2 Answers

Mike Hatch
14,940 PointsYou have it mostly right. In Task 2 you omitted using "this". It's the same as you did in Task 1 but instead use brackets which you already did.
This be damned!

Brian Johnson
Front End Web Development Techdegree Graduate 20,806 PointsThat Worked!! You are the man Mike. I appreciate your help.
Brian Johnson
Front End Web Development Techdegree Graduate 20,806 PointsBrian Johnson
Front End Web Development Techdegree Graduate 20,806 PointsHey Mike I tried putting the “this” keyword in front of the “name property like this ex) return this[‘name] ... and that didn’t work. I’m stuck
Mike Hatch
14,940 PointsMike Hatch
14,940 PointsHey Brian.
Leave the code you provided in your original question exactly as it is. You were 90% correct already. Now that you've added "this" before "name", the only mistake you're making is omitting a single quote mark after 'name.' Also, make sure there is a space after "return."