Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Loops, Arrays and Objects Tracking Data Using Objects Create an Array of Objects

Sonja Tomcic
Sonja Tomcic
6,590 Points

Help. I don't know how to do this

i've tried, but it says task one is no longer passing

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>

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! I really wish I knew what you'd tried that's failing. But likely as not, you had a typo somewhere. When it says task 1 is no longer passing it means that you've introduced a syntax error into your previously working code. Here's what I did:

var objects=[
  {
    name: "Jennifer",
    course: "C#"
  },
  {
    name: "Steven",
    course: "JavaScript"
  },
  {
    name: "Kevin",
    course: "CSS"
  }
  ];

Hope this helps! :sparkles:

Sonja Tomcic
Sonja Tomcic
6,590 Points

Thanks, i didn't put quotation marks. That was the problem

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Sonja Tomcic ah ha! That'll do it, assuming the value is a string. However, if you'd had a key pair like this:

{
  name: "Anne",
  points: 3903
}

then the points wouldn't need quotations as it would be an integer. :smiley: