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 trialJanice Childers
18,958 PointsCan't get results to print in Chrome.
What am I missing here? I keep comparing my code to his in the video and not seeing a difference. Java console also detects no errors.
2 Answers
LaVaughn Haynes
12,397 PointsTry typing Dave with an uppercase D at the prompt and see if that works. If it does the the reason your code doesn't print is because the name you entered and the students names are different cases, so the line below returns false and doesn't execute the print code
if (student.name===search) {
You can make them both the same case, or be sure to enter the name at the prompt with an uppercase first letter
if (student.name.toLowerCase() === search.toLowerCase()) {
Janice Childers
18,958 PointsThanks -- that was it! I was typing the names in lower case.
Paolo Villanueva
7,654 PointsJavaScript* console
Do you have a div with an id of output?
Janice Childers
18,958 PointsJanice Childers
18,958 Points