Javascript if in x
<blockquote>
  <p><strong>Possible Duplicates:</strong><br>
  <a href="http://stackoverflow.com/questions/5252650/test-for-value-in-javascript-array">Test for value in Javascript Array</a><br>
  <a href="http://stackoverflow.com/questions/143847/best-way-to-find-an-item-in-a-javascript-array">Best way to find an item in a JavaScript Array ?</a><br>
  <a href="http://stackoverflow.com/questions/237104/javascript-array-containsobj">Javascript - array.contains(obj)</a>  </p>
</blockquote>



<p>I usually program in python but have recently started to learn JavaScript.</p>

<p>In python this is a perfectly valid if statement:</p>

<pre><code>list = [1,2,3,4]
x = 3
if x in list:
    print "It's in the list!"
else:
    print "It's not in the list!"
</code></pre>

<p>but I have had poblems doing the same thing in Javascript.</p>

<p>How do you check if x is in list y in JavaScript?</p>
