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

Nicholas Nash
Nicholas Nash
6,494 Points

Could somebody tell me if this is a bug?

Not sure on whether my code is complete or if I have a bug on my hands.

script.js
var objects = [ 
   {
    name: Nick,
    location: Cookeville
  } ,
  {
    name: Rick,
    location: Cokeville
  },
  {
    name: Dick,
    location: Cookieville
  }
 ];
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

Steven Parker
Steven Parker
231,236 Points

:point_right: String literals should be enclosed in quotes.

For example, one of your object properties might look like this:

    name: "Nick",

So in answer to your question, no, it's not a bug. Since a syntax error invalidates the whole thing, and the checker re-tests task 1 first, it says "task 1 is no longer passing". Potentially confusing, yes, but not a bug. :smile:

Nicholas Nash
Nicholas Nash
6,494 Points

Awesome! I can't believe I looked over that! Thank you!