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.

David Aguirre
8,170 PointsA quick refresh
So in this case in the UpdateGameState method
the final line it's concatenating the to get the specific winner.
Can somebody explain the syntax and how it works?
this.gameOver( ${target.owner.name} wins!)
1 Answer

Steven Parker
220,378 PointsHere's that line with formatting:
this.gameOver(`${target.owner.name} wins!`);
The "gameOver" method of the current object ("this") is being called, and passed a string argument.
The argument is constructed with a template literal which includes a placeholder (enclosed with "${}") to be substituted. The substituted value is the "name" property of the "owner" object which is a property of the "target" argument that was given to this method.
Does that clear it up?