title: Splice multiple arrays in multidimensional array javascript
body: <p>I have an multidimensional array</p>
  
  <pre><code>[{id:0, type:1}, {id:1, type:1}, {id:2, type:2}]
  </code></pre>
  
  <p>What I aim to do is to remove all type 1 and so the desired result should leave <code>id:2, type:2</code></p>
  
  <pre><code>tmpType = 1;
  for (var i in arr) {
      if(arr[i].type == tmpType) {
          arr.splice(i, 1);
      }
  }
  </code></pre>
  
  <p>However in the loop, from what I understand it will loop thrice but everytime I splice, the loop differs. This is the result I am getting.</p>
  
  <pre><code>{{id:1, type:1}, {id:2, type:2}}
  </code></pre>
  
  <p>If i have 3 kinds of type:1, I will always have the last one still in the array.</p>