Infinite looping alert box in javascript : <p>My question is, how come my "You got it!" alert keeps going on infinitely? I know I can make it break there, but I want to know why it keeps doing that. It should have that secret_number===answer and break out of the while loop, so obviously it's not doing that, and I don't get why. Thank you :)</p>

<pre><code>var secret_number=Math.floor((Math.random() * 10) + 1); 
var answer=parseInt(prompt("Enter a number you want to try"));

while(secret_number!==answer)
{
if(answer == null || answer == "" ||isNaN(answer))
break;

if(answer&gt;secret_number)
answer=prompt("This number is too high!");

else if(answer&lt;secret_number)
answer=prompt("This number is too low!");

else
alert("You got it!");
}
</code></pre>
