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

B A-W
B A-W
3,531 Points

Is is the browser or the code that's the problem?

Not sure what it 'wrong' with my code. I've checked it in the browser, checked it alongside the video, checked it alongside the video files but can't see the issue as to why the array info doesn't show. Here is a snapshot:

https://w.trhou.se/h3s54n55eg

Thanks in advance

3 Answers

Steven Parker
Steven Parker
231,007 Points

It's normal for modern browsers to not render the page until after the JavaScript component finishes running (in this case, after you type "quit"). This behavior may differ for some types or older versions of browsers. The video was probably made using an older version of Chrome that rendered while the program was still running.

In later courses, you will learn how to get input interactively using form fields so there will be no delay.

Also, be aware that even though the prompt asks for "first name", the code will only match a record if you input the whole name. Also, the name is case-sensitive so the capitalization must match exactly with what is in the data.

You can change these things with extra code, but that's how it works now.

Reed Jones
Reed Jones
1,196 Points

I tried your code in my browser (Chrome). It doesn't work. Must be a browser issue. I was having the same problem, basically no way to exit the loop unless you type 'quit'. Then the object prints to the page.

B A-W
B A-W
3,531 Points

Yes! That's exactly what happened to me - I was using Chrome too

Ryan Emslie
seal-mask
.a{fill-rule:evenodd;}techdegree
Ryan Emslie
Full Stack JavaScript Techdegree Student 14,453 Points

I had the same issue using Chrome. I loading my index.html in Firefox and it worked perfectly. I could have saved myself a lot of time by reading these comments earlier.

All works for me. If you get stuck, it's better to add 'debugger;' into your code and check what's wrong step by step.It always helps me.