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 Student Record Search Challenge Solution

I can't make the search results print out onto the page

The search results won't print out onto the page! I already had a similar problem in the previous videos with the text not printing out onto the page! I have tried document.write method and the print(message) function. Both didn't work. I have been testing this for a while and I think it could be team treehouse's website. I have tried reinstalling Chrome, trying it on Safari, and trying it on Firefox but it doesn't work. I have copied exactly what Dave wrote in this video and it still doesn't work. Here is a link to my workspace... https://w.trhou.se/y3uwuk0c85

8 Answers

Rachelle Wood
Rachelle Wood
15,362 Points

Hi.

You did not set var i to any value in your for loop. You have to set it to 0.

Rachelle Wood
Rachelle Wood
15,362 Points
for (var i = 0; i<students.length; i++) {
rest of code
} ```

Here's a link to it edited... https://w.trhou.se/y3uwuk0c85 But how do you make it keep prompt popping up?

Rachelle Wood
Rachelle Wood
15,362 Points

Sorry your link goes to an empty workspace.

I updated it. Try clicking it again.

I switched the direction of the greater than sign so it should continue to pop up the prompts; but now it doesn't print the student info when I type in the student name.

Rachelle Wood
Rachelle Wood
15,362 Points

Hi, there is one more thing to change in your code. message = getStudentReport(student); rather than with +=

I tried that and it didn't change anything.