title: Javascript, Fastest way to know if a certain value is in a array?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/237104/array-containsobj-in-javascript">array.contains(obj) in JavaScript</a>  </p>
  </blockquote>
  
  
  
  <p>Let's say I have an array = [0,8,5]</p>
  
  <p>What is the fastest way to know if 8 is inside this one.. for example:</p>
  
  <pre><code>if(array.contain(8)){
   // return true
  }
  </code></pre>
  
  <p>I found this : <a href="https://stackoverflow.com/questions/7571635/python-fastest-way-to-check-if-a-value-exist-in-a-array">Fastest way to check if a value exist in a list</a> (Python)</p>
  
  <p>and this : <a href="https://stackoverflow.com/questions/308191/fastest-way-to-detect-if-a-value-is-in-a-set-of-values-in-javascript">fastest way to detect if a value is in a set of values in Javascript</a></p>
  
  <p>But this don't answer to my question. Thank you.</p>