title: Detect if object in array has one same property but different other property to other objects
body: <p>Take this array:</p>
  
  <pre><code>[
    {"color": "blue","type": 1},
    {"color": "red","type": 1},
    {"color": "blue","type": 1},
    {"color": "green","type": 1},
    {"color": "green","type": 1},
    {"color": "red","type": 2},
    {"color": "red","type": 1},
    {"color": "green","type": 2},
    {"color": "red","type": 3},
  ];
  </code></pre>
  
  <p><strong>How would I go about finding which "color" has a different "type" (than all other objects with the same "name") in the array?</strong></p>
  
  <p>I want to be able to loop through this array and create a second array that would look like this:</p>
  
  <pre><code>{red, green}
  </code></pre>
  
  <p>Notice blue is ommited because all of the objects with "color":"blue" have the same "type"</p>
  
  <p>The closest I have gotten is this: <a href="https://jsfiddle.net/0wgjs5zh/" rel="nofollow">https://jsfiddle.net/0wgjs5zh/</a> but it adds all colors into the array appended with the different types:</p>
  
  <pre><code>arr.forEach(function(item){
    if(newArr.hasOwnProperty(item.color+ '-' +item.type)) {
     // newArr[item.color+ '-' +item.type].push(item);
    }
    else {
      newArr[item.color+ '-' +item.type] = item;
    }
  });
  
  // RESULT
  {blue-1, green-1, green-2, red-1, red-2, red-3}
  </code></pre>