JavaScript JavaScript Loops, Arrays and Objects Tracking Data Using Objects The Student Record Search Challenge Solution

Tetsuya Yokoyama
Tetsuya Yokoyama
11,286 Points

I can't figure out why it doesn't work......

I tried this challenge and made code like this. I thought it would work but it doesn't.

There should be some mistake in for loop... but I can't figure it out by myself. It looks unorganized and it might be really easy to solve... Could someone give me your hand to fix this?

https://w.trhou.se/6d0kdycvpx

Thanks, Tetsuya

1 Answer

Steven Parker
Steven Parker
202,019 Points

This code seems OK. Did you read the "Important Update" in the Teacher's Notes?

But if that's not it, please describe what kind of problem you are having with it.

Tetsuya Yokoyama
Tetsuya Yokoyama
11,286 Points

Hi Steven,

Thank you for your reply.

Sorry it wan not enough explanation. My code pops up prompt and it stops when I type "quit". But if I type correct student's name there's nothing to come out on HTML text at the moment. After some attempts to type the correct name, then I type "quit" multiple student info shows up. So the HTML text is only showed up after I type "quit".......

It's like if I tried Ted, Karen, James, Ted (Ted is the only correct name of student in the list.) There's nothing shows up, then if I try "quit", the text shows two Ted's info at the same time.

I think this is what my code does, sorry if my English is not that clear.

Thanks, Tetsuya

Steven Parker
Steven Parker
202,019 Points

What you are describing is the correct behavior. This is explained in the "Important Update" in the Teacher's Notes.

Tetsuya Yokoyama
Tetsuya Yokoyama
11,286 Points

OMG, I'm sorry about this. I didn't pay attention to that part at all......

I'm so sorry and really appreciate that you answered to this stupid question. Thank you very much.