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

Error encountered that I can't figure out...

I'm running the workspace from the challenge. When I run it, I get the following error:

Uncaught SyntaxError: Unexpected end of input

This is in line 1 of the student_report.js:

var message = '';

Why am I getting this? The line ends with a semicolon and everything looks exactly as in the challenge.

2 Answers

Colin Bell
Colin Bell
29,679 Points

Is that the only code? Usually Unexpected end of input means there is a missing ) or } somewhere.

Ahhhh... sure enough, I was missing a } at the end of the program. Thanks!

Colin Bell
Colin Bell
29,679 Points

It's a definitely a frustrating error since it usually shows it as being on line one when the actual source of the error usually isn't.

TJ Egan
TJ Egan
14,420 Points

try just

var message;

Nope. Didn't help. Should you be able to initialize anyway?