title: Find and remove element from array
body: <p>If I have a javascript array of numbers</p>
  
  <pre><code>[1, 2, 5, 7, 5, 4, 7, 9, 2, 4, 1]
  </code></pre>
  
  <p>And I want to search through that array and remove a particular number like 4 giving me</p>
  
  <pre><code>[1, 2, 5, 7, 5, 7, 9, 2, 1]
  </code></pre>
  
  <p>What's the best way to do that</p>
  
  <p>I was thinking it might look like</p>
  
  <pre><code>for(var i = 0; i &lt; myarray.length; i++) {
      if(myarray[i] == 4) {
          myarray.remove(i)
      }
  }
  </code></pre>
  
  <p>But there is no <code>remove</code> function for an array.  Also if I remove an element from the array it messes up my <code>i</code> unless I correct it.</p>