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

Phong Somlith
Phong Somlith
5,675 Points

Student Record Search Challenge... code not working

I followed Dave's code solution but somehow my code is not displaying the student's records when typing in an existing student name. Am I missing something here? Please help!

code below:

https://w.trhou.se/ctqwnc5qp4

2 Answers

David Alberto Mogollon
seal-mask
.a{fill-rule:evenodd;}techdegree
David Alberto Mogollon
Full Stack JavaScript Techdegree Student 13,759 Points

well i saw your code, you just need to be sure about the lowerCases in the line 25.

try replacing with this :

if ( student.name.toLowerCase() === search.toLowerCase() ) {

also if you want to get all the students with the same name you can check my code :

https://w.trhou.se/ogmqn8b7m7

Phong Somlith
Phong Somlith
5,675 Points

Thank you very much David. Your suggestion works! I really like the simplicity of your code