title: Removing an element from an array specifying a value in Javascript
body: <p>I have read this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/500606/javascript-array-delete-elements">Deleting array elements in JavaScript - delete vs splice</a></p>
  
  <p>And it appears that both splice and delete require an index of the element in order to remove, so how can I easily find the index when I have the value?</p>
  
  <p>For example if I have an array that looks like this:</p>
  
  <pre><code>["test1", "test2", "test3"]
  </code></pre>
  
  <p>and I want to remove test2. The process I am using right now, which I'm hoping isn't the correct way to do it, is using <code>$.each</code> checking the value of each element in the array, maintaining a counter through the process (used as the index reference) and if the value is equal to "test2", then I have my index (in form of the counter) and then use splice to remove it.</p>
  
  <p>While the array grows larger, I would imagine this would be a slow process, but what alternatives do I have?</p>