Help with Loops in JS

Hello, I am currently learning JS and I am practicing loops using this page:

Here is my code, which is exactly what is on the page above:
https://bit.ly/3elCU1e

The exercise I am doing is the one in the Exiting Loops w Break Section. I copied the code into my visual studio code to practice the syntax but the problem is as follows.

In the guide I am following, under the exercise is a sample of the code working, which works each time I put in a name. However, when I write the code and run it in my browser, I can only look up a contact successfully one time, after that, any search returns “Contact Not Found,” unless I refresh the page. Does anyone know why this is happening? Is my code missing something?

Hello @Nathaniel_Rod,

I just had a look, your code is not missing something but “having” something “extra” which is not needed.

All of this revolves around the way you reset the value for the input.
If you watch searchName(let say by adding console.log(searchName); after affecting the value), you’ll notice something off after the first try :slight_smile:

Hope this helps, let me know if not.
Julien