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 The Build an Object Challenge, Part 2 Solution

Hui Zheng
PLUS
Hui Zheng
Courses Plus Student 1,380 Points

My student list didn't print

I was following alone with this exercise, and I did everything according to the video step by step except I only added three object literals to my array. Nevertheless, everything else I did was exactly as what was instructed from the video. When I opened up the browser, only the student title was displayed but the student list didn't appear.

Can you post a snapshot of your workspace? It is the camera icon in the upper right corner.

1 Answer

I found three things to fix:

(1) Missing end quote for 'output' in print function

(2) Missing closing curly brace for print function

function print(message) {
  var outputDiv = document.getElementById('output');
  outputDiv.innerHTML = message;
}

(3) Missing script reference for students_report.js in index.html

<script src="js/students.js"></script>
<script src="js/students_report.js"></script>