Javascript comparisons not working with prompts, while loop, and !== -


what i'm trying prompt user repeatedly until 1 of accepted answers received. pretty easy stuff. while loop, however, making weird , annoying. here's got:

var plrchoice=prompt("would choose bulbasaur, charmander, or squirtle? (use lowercase characters)"); while(plrchoice!=="bulbasaur"||plrchoice!=="charmander"||plrchoice!=="squirtle"){         plrchoice=prompt("would choose bulbasaur, charmander, or squirtle?");     } 

this should work in theory, result infinite do/while, regardless of user inputs. in advance :)

those || should &&.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -