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

What am I doing wrong? It is telling me the value for inTurn should be true, that is what I have???

Help

object.js
const player1 = {
  name: 'Andrew',
  color: 'red',
  isTurn: 'true',

}

3 Answers

Alexander Solberg
Alexander Solberg
14,350 Points

You have entered true, as a string. Remove the single quotes and it should work. true/false are part of a primitive datatype in javascript called a "Boolean". When you write the values inside quotes, you turn them into a string, which is another primitive datatype.

You have true as a string value. True and false are boolean data types and do not require quotes

Thanks, it worked just great after I removed the quotes.