I am trying to understand why the below code does not work even though a variation of it works. My understanding eventually both mean the same thing.(I am pretty sure I am wrong, but don't know why)
this works
while (!(luc === 'rock' || luc === 'paper' || luc === 'scissor')) {
this does not work
while (luc !== 'rock' || luc !== 'paper' || luc !== 'scissor')) {
Here is complete context
var uc = prompt('Choose between Rock, Paper and Scissor')
var luc = uc.toLowerCase();
while (!(luc === 'rock' || luc === 'paper' || luc === 'scissor')) {
var uc = prompt('You did not select between rock paper and scissor')
var luc = uc.toLowerCase();
}
console.log(uc)