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 trialJustin Oswald
5,969 PointsI have tried various combinations answers and cant seem to find what its asking for
.
var objects = [
name= {'Justin'},
numbers= {4},
answer= {true}
]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Objects</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
2 Answers
Austin Whipple
29,725 PointsIn this challenge, there's no need to modify the HTML file, so there shouldn't be any issue there. In the JavaScript, however, you're asked to create an array of object literals that each contain to property/value pairs.
You're successfully creating your objects
array. In addition, you're creating the objects in the array properly. However, you're not declaring your properties or assigning values. You'll need to create two properties for your name
object. For instance, first:
and last:
name:
name = {first: , last: }
This won't pass quite yet because you still need to assign values to these properties:
name = {first: 'Justin', last: 'Oswald'}
And repeat for two other new objects in your array. For more information on working with objects can be found in the MDN.
Tim Strand
22,458 PointsInside the array literal, add three object literals. In other words, the objects array should have three values. Each object should have 2 property/value pairs. Step 1) declare the array literal (you have done this. dont forget the semicolon Step 2) create 3 object literals {} with 2 values apiece {key: value, key: value} (you havent done this)