title: Matching a value to JSON array values in jquery
body: <p>I have a JSON array that looks like this:</p>
  
  <pre><code>['Monkey','Cheetah','Elephant','Lizard','Spider']
  </code></pre>
  
  <p>I also have a text input. I want to test whether the value of the input upon 'blur' is also in the array and if it is do something.</p>
  
  <p>Knowing a bit of python I tried something like this:</p>
  
  <pre><code>var existing_animals = ['Monkey','Cheetah','Elephant','Lizard','Spider']
  $('input').blur(function() {
    user_animal = $(this).val()
    if (user_animal in existing_animals) {
      alert('Animal already exists!')
    }
  });
  </code></pre>
  
  <p>So, how rookie is my mistake?</p>