What I thought this code would do is, if i typed non-numbers it would continue prompting me until I finally input a number which it then will output the word "one" on the page.
What it does is if I type a number first it outputs the word "one" on the page. If i type a non-number it continuously loops even if I put a number afterwards.
And this is a learning experiment. So please be nice
<script type="text/javascript">
var luckynumber = prompt("Whats the number?");
luckynumber = parseInt(luckynumber);
while(isNaN(luckynumber)) {
prompt("Numbers only!")
}
if (! isNaN(luckynumber)) {
document.write('one')
}
</script>