Practice exercise - Loops, If-else & Boolean's

I think I misunderstood the last question, 28. While loop with input.

Exercise:

this is what I came up with -

“<script>
var usernumber = prompt(“Give me a number”);
var outputnumber = 0
while (outputnumber < usernumber) {
console.log(outputnumber);
outputnumber = outputnumber + 1;
alert(“are you enjoying this yet, only “+(usernumber-outputnumber)+” left to go”)
}
</script>”

I found this amusing anyway, especially when someone enters a large number

1 Like

Hi @Jargo,

Your answer seems to align with the question. The only thing is instead of console.logging your answer you are showing it as an alert which will make your program stop at every iteration.

However, your answer to the question achieves the goal so that is enough.

Happy learning! :smile: