title: Find out if a variable is in an array?
body: <p>I have a variable:</p>
  
  <pre><code>var code = "de";
  </code></pre>
  
  <p>And I have an array:</p>
  
  <pre><code>var countryList = ["de","fr","it","es"];
  </code></pre>
  
  <p>Could someone help me as I need to check to see if the variable is inside the countryList array - my attempt is here:</p>
  
  <pre><code>    if (code instanceof countryList) {
          alert('value is Array!');
      } 
  
      else {
          alert('Not an array');
      }
  </code></pre>
  
  <p>but I get the following error in console.log when it's run:</p>
  
  <blockquote>
    <p>TypeError: invalid 'instanceof' operand countryList</p>
  </blockquote>