title: checking for a variable match with an array in JavaScript
body: <p>I am teaching myself JavaScript and I want to write a simple program that will check if a user input is in a pre-existing array.</p>
  
  <p>example code is:</p>
  
  <pre><code> var options = ['rock','paper','scissors'];
   var choice = 'scissors';
  
  
  
  var i;
  
      for (i=0;i&lt;options.length;i++){
          if (choice === options[i]){
              console.log('match');
          }
  
      }
  </code></pre>
  
  <p>I tried with adding an else, that would prompt the user to enter a new input, but it runs every time the for loops goes through the array objects that don't match the input.</p>
  
  <p>My end goal is to have this little program prompt the user for a new input only once when it detects that their input does not match any of the array objects.</p>