title: Remove Object from multidimensional Array
body: <p>I´m trying to remove an Object in an array.</p>
  
  <p>The situation is the following. </p>
  
  <p>In the code i generate a new Post object, which i`ll push to an post_array</p>
  
  <pre><code>var field = "Kommentar";
  var objectKey = 1;
  var new_post_obj = {objectKey: objectKey, field: field, value: new_value, type: "text"};
  post_array.push(new_post_obj);
  </code></pre>
  
  <p>Thats working fine.
  I do not want to have an new_post_obj in the post_array with the same objectKey and the same field.
  For that i`d like to remove the post Objects in the post_array which have the same objectKey and field as a new Object i want to Post. And then push the new_post_obj.</p>
  
  <p>For example the post_array has following data:</p>
  
  <pre><code>[
  {objectKey: "1", field: "Kommentar1", value: "kommentar123", type: "text"},
  {objectKey: "1", field: "Color", value: "red", type: "text"}
  ]
  </code></pre>
  
  <p>My new_post_obj has this new Data</p>
  
  <pre><code>{objectKey: "1", field: "Kommentar1", value: "kommentar123456", type: "text"}
  </code></pre>
  
  <p>Now i need to remove the old data with objectKey: 1 and field: "Kommentar1"</p>
  
  <p>I tried the following code:</p>
  
  <pre><code>post_array = $.grep( post_array, function(n) {
      return (n.field != field &amp;&amp; n.objectKey != objectKey);
  });
  </code></pre>
  
  <p>After that i excpect that my post_array has only this value:</p>
  
  <pre><code>{objectKey: "2", field: "Color", value: "red", type: "text"}
  </code></pre>
  
  <p>But it`s empty. How can i solve this?</p>