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 JavaScript Loops, Arrays and Objects Tracking Data Using Objects Create an Array of Objects

I have no clue what is happening here

I know what is object literal, I have used 3 and there is still an error

script.js
var objects = [


];
index.html
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JavaScript Objects</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>

4 Answers

Great job on completing Challenge 1 . Now All that you have to do for challenge 2 is put in 3 object literal with 2 prop/val pairs. So it should be something like this

var objects = [
  {name:'John',age:16},
  {name:'Jill',age:18},
  {name:'Jack',age:17}
]
Antonio De Rose
Antonio De Rose
20,885 Points

yes, so you got the first question right, and what have you tried on the second question.

Oh, I see, that part wasn't clear to me. This is what I've tried

var objects = [
 {name: 'Jhon'}, 
 {name: 'Jack'},
{name: 'Maria'}
];
          ```
Antonio De Rose
Antonio De Rose
20,885 Points

it is not a javascript error, but the error against your question, as it asks 2 properties each object.