I am new to javascript and programming in general and I'm confused with this while loop. What does the while condition of true mean? It's very confusing to me because I'm used to seeing while loops with a defined variable and a condition actually comparing something. However, in this example in the book the variable "answer" is undefined and the condition of the while loop is just "(true)".
var answer;
while (true) {
answer = prompt("You! What is the value of 2 + 2?", "");
if (answer == "4") {
alert("You must be a genius or something.");
break;
}
else if (answer == "3" || answer == "5") {
alert("Almost!");
}
else {
alert("You're an embarrassment.");
}
}