Jason Castillo Jason Castillo - 10 months ago 96
Javascript Question

Do/while loop not working?

Here's the code:

do {
var selection=prompt("Enter password","");
} while(selection!="pass"||selection!="winner");

I'm trying to allow both "pass" and "winner" as a password for the prompt, but something goes wrong around the
, because the code works without it. I feel like the answer is right under my nose but I can't find it


It is hard for a single string to equal both "pass" and "winner" at the same time.

You probably want && instead of ||.