Can't exit do while loop

I’m building a simple Rock, Paper, Scissors that I can play via a browser console. Using a do/while loop, I’m prompting to select one of three acceptable options "rock", "paper" or "scissors". As soon as the player inputs one of these 3 acceptable options, the do/while loop should terminate. The problem is that it doesn’t.

function playerPlay(){
    let choice;
    do{
      choice = prompt("Rock, paper or scissors?").toLowerCase();
      console.log(choice);
      console.log(choice !== "rock" || choice !== "paper" || choice !== "scissors");
      console.log(choice === "rock" || choice === "paper" || choice === "scissors");
    } while (choice !== "rock" || choice !== "paper" || choice !== "scissors");
    return choice; 
  }

  playerPlay();

I’ve been trying to debug with console.log and find it mind-boggling that the prompted choice given by the player seems to be working fine (see screen shot below) and that:

  1. When input is "rock", "paper" or "scissors", the two console.log boolean tests log "true". The first console.log should log false (unexpected) while the second should log true (expected).

  2. When input is "notRockPaperScissors", the first console.log boolean test logs true (expected) while the second console.log boolean test logs false (expected).

enter image description here

I’m certainly missing the obvious, but as a beginner, I just can’t see what’s causing this to happen and understanding the cause would definitely help me (and likely other learners). Thanks for helping!

15 thoughts on “Can't exit do while loop”

  1. You really make it seem so easy with your presentation but I find this topic to be really something which I think I would never understand.
    It seems too complicated and extremely broad for me.

    I’m looking forward for your next post, I will try to get the hang of it!

    Reply
  2. Hier, in neben anderen das für Mallorca typischen historischen Windmühlen, haben sich Küchenmeister Dirk Wendt und seine Frau Svenja niedergelassen. In der Moli de Vent
    haben sie sich das Ziel gesetzt, beste regionale Zutaten auf kreative Weise zu servieren. Asiatische
    Gewürze und exotische Ingredienzien genügend verwendet,
    lassen traditionelle Gerichte wie z.B. Braten vom schwarzen Schwein neu erscheinen. Sie bieten einen reizvollen Kontrast zum mediterranen Ambiente der Moli de Vent.
    Im Stay in der malerischen Bucht von Puerto Pollensa liebt man die Kombination einheimischer Produkte
    und Rezepte mit orientalischen Elementen. Zu
    jeder Tageszeit kann man dort in den elegant eingerichteten,
    modern-mediterranen Räumlichkeiten oder auf der großen Terrasse vorzüglich speisen. Köstlichkeiten aus der
    Küche des Mittelmeeres, eine reichhaltige Auswahl an Fisch und Meeresfrüchten und raffinierte Tapas ich lobe mir
    der Karte. Wie eine Kathedrale öffnet sich die riesige Sandsteinhöhle
    in luftige Höhen. Und hier drinnen ein Restaurant? Ja!
    Hier findet sich das Restaurante Galdent Llucmajor.
    In den ehemaligen Steinbruch nahe daran des Puig de
    Randa hat man kunstvoll eine Küche und einen Gastraum integriert.

    Reply
  3. My brother recommended I might like this website. He used to be entirely right.
    This put up actually made my day. You can not consider just
    how a lot time I had spent for this info! Thank you!

    Reply
  4. You actually make it seem so easy with your presentation but I find this matter to be really something which I think I would never understand.
    It seems too complicated and extremely broad for me. I am looking forward for your next post, I will try to get the hang of it!

    Reply
  5. Simply wish to say your article is as astounding.
    The clarity in your post is just great and i could assume you are an expert on this subject.
    Well with your permission let me to grab your RSS feed to keep up to date with forthcoming post.
    Thanks a million and please continue the enjoyable work.

    Reply
  6. I am no longer sure where you are getting your info, but good topic.
    I needs to spend some time finding out more or working out more.
    Thank you for excellent information I was on the lookout for this info for my mission.

    Reply
  7. You actually make it appear so easy together with your presentation but I find
    this topic to be really one thing that I feel I’d by
    no means understand. It kind of feels too complicated and very huge for
    me. I am looking ahead on your subsequent submit, I will attempt to get the hold of it!

    Reply
  8. Hi would you mind sharing which blog platform you’re using?
    I’m going to start my own blog in the near future but
    I’m having a hard time selecting between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design and style seems
    different then most blogs and I’m looking for
    something unique. P.S Apologies for
    getting off-topic but I had to ask!

    Reply

Leave a Comment