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 trialAdewuyi Kupolati
Courses Plus Student 8,887 PointsInside the array literal, add three object literals. In other words, the objects array should have three values.
I can't answer my question. I need help please. Thank you.
var objects = [
{month: 'June', answer: LGBT},
{month: 'September', answer: Birth},
{month: 'February', answer: Pisces}
];
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Objects</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
4 Answers
Marcus Parsons
15,719 PointsHi Adewuyi,
The reason why you're getting an error is because the 2nd property in each of your objects isn't encapsulated by a set of quotes. Each of those values should be strings surrounded by single or double quotes :)
//I added single quotes to each value
//but you can use either single or double quotes for each value
var objects = [
{month: 'June', answer: 'LGBT'},
{month: 'September', answer: 'Birth'},
{month: 'February', answer: 'Pisces'}
];
Tyrell Jentink
8,415 PointsStrings have to go inside quotes. SO, you are looking for:
var objects = [
{month: 'June', answer: 'LGBT'},
{month: 'September', answer: 'Birth'},
{month: 'February', answer: 'Pisces'}
];
Adewuyi Kupolati
Courses Plus Student 8,887 PointsThank you so much. Thank you. Quotations. Thanks.
Marcus Parsons
15,719 PointsYou got it right! You're welcome, and happy coding! =]
Barry Barnes
18,631 Pointsn00b!!! Just kidding, I needed help too :)
Thanks!