title: Javascript, remove property from one of two similar objects in array
body: <p>Let's assume we have this data set:</p>
  
  <pre><code>var array = [
                  {
  
                          "name": "a",
                          "group": "a"
                  },
                  {
                          "name": "a",
                          "group": "a"
                  },{
                          "name": "b",
                          "group": "b"
                  },
                  {
                          "name": "b",
                          "group": "b"
                  },
                  {
                          "name": "c"
                  }
              ];
  </code></pre>
  
  <p>and I want to loop through the array to see if there are two objects have the same group value, then remove the second of them.</p>
  
  <pre><code>for(var i = 0 ; i&lt;array.length;i++){
                  var a = array[i];
                  for(var j = 0; j&lt; array.length;j++){
                      if(array[j].group == a.group){
                          var b = array[j];
                          // I need code here to remove property "group" from the variable b only
                          break;
                      }
                  }
              }
  </code></pre>
  
  <p>the final results I want are:</p>
  
  <pre><code>var array2 = [
                  {
                      "name": "a",
                      "group": "a"
                  },
                  {
                      "name": "a"
                  },{
                      "name": "b",
                      "group": "b"
                  },
                  {
                      "name": "b"
                  },{
                      "name":"c"
                  }                    
              ];
  </code></pre>
  
  <p>NOTE: I tried <code>delete array[j].group</code> but it caused to remove both <code>group</code> property from both equal objects. How can I solve that?</p>