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 Creating Object Literals

Challenge Task 1 of 2 Fill in the missing code for the object literal. To do

Fill in the missing code for the object literal. To do this, inside the curly braces, create three key value pairs for properties name, color, and isTurn. The values for name and color should be any string value, and the value for isTurn should be true.

object.js
const player1 = {

}
Antonio De Rose
Antonio De Rose
20,885 Points

if you aren't able to knock off this task, please go through the previous video again and again, this is the entry point for the object literal.

4 Answers

const player1 = { name: 'Josh', color: 'blue', isTurn: true }

const player1 = { name: 'Lar', color: 'red', isTurn: true }

const player1 = { name : '', color: '', isTurn:true }