title: Which is faster for finding element in javascript array?
body: <p>I'm a noob and wrote a whole program without knowing the easy way to find an element in an array...</p>
  
  <pre><code>my_array.indexOf("find this value");
  </code></pre>
  
  <p>Is indexOf a lot better than storing how many elements are in an array, and looping through the array until you find the element you want? I could have simplified my code alot. </p>
  
  <p>I tried to make my lookups constant time by using multiple arrays, and storing the keys. It makes insertions/deletes slow because I have to update the keys though.</p>
  
  <p>Should I have just used indexOf?</p>
  
  <p>Thanks</p>