Firstly, don't redefine answer (remove var from the loop). Secondly, think about the three possible cases your loop has:
answer = "yes" -> (answer != "yes") is false, (answer != "yeah") is true. The loop continues.
answer = "yes" -> (answer != "yes") is true, (answer != "yeah") is false. The loop continues.
answer = "anything else" -> (answer != "yes") is true, (answer != "yeah") is true. The loop continues.
Using a logical AND && operator should resolve your issue:
var answer = prompt("Are we there yet?");
while (answer != "yes" && answer != "yeah") {
answer = prompt("Are we there yet?");
}
alert("YAY! We made it!!");
&&instead of||.&&, not||.answer == "yes"then it's not equal to"yeah". Whenanswer == "yeah"then it's not equal to"yes""yes". Then your condition is "if false or true try again". If you typeyeah, it's "if true or false try again". If you type anything else, it's "if true or true try again". There is no scenario in which your code doesn't try again.