title: Remove object from array based from another array
body: <p>This is the structure of my first array:</p>
  
  <pre><code>var myArray = [1,Firstname,Lastname];
  </code></pre>
  
  <p>My second array is consist of object with property:</p>
  
  <pre><code>var mySecondArray = [object, object, object];
  </code></pre>
  
  <p>And when you expanded it, on the first array object it will show something like this:</p>
  
  <pre><code>Id = 1
  FirstName = Test
  LastName = TestLastName
  </code></pre>
  
  <p>I need to remove the object if it has the same <code>id</code> from the first array. I tried using this but no luck:</p>
  
  <pre><code>// if condition
  myArray.splice(mySecondArray[x].ID, 1);
  </code></pre>
  
  <p>Any idea?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>So this is the whole idea. I have array of all my items (objects) and i have array of invalid items (in this case this is the string array)</p>
  
  <pre><code>var originalLength = validRowsArray.length;
  for (var x = 0; x &lt; invalidRowsArray.length; x++) {
      for (var y = 0; y &lt; originalLength; y++) {
          if (validRowsArray[x].ID != invalidRowsArray[y][0]) { // 0 is the position of ID
              validRowsArray.splice(validRowsArray[x], 1);
          }
      }
  }
  </code></pre>