title: How to check if array is unique on specific object property?
body: <p>I have an array of objects:</p>
  
  <pre><code>var array1 = [
    {
      property1: 10,
      property2: "abc"
    }, 
    {
      property1: 11,
      property2: "def"
    },
    {
      property1: 10,
      property2: "ghi"
    }
  ];
  </code></pre>
  
  <p>Now what I want is this array will be said not unique as per value of <code>property1</code>.</p>
  
  <p>This means that this array contains 2 elements with <code>property1=10</code>, so the array does not contain unique value of <code>property1</code>.</p>
  
  <p>To check this, I can use a <code>for</code> loop:</p>
  
  <pre><code>for (var i = 0; i &lt; array1.length; i++) {
    var array2 = array1.slice(); // copy array
    array2.remove(array1[i]);
    var temppropety1 = array1[i].property1;
    for (var j = 0; j &lt; array2.length; j++) {
      if (array2[J].property1==temppropety1) {
        return true;
      }
    }
  }
  </code></pre>
  
  <p><strong>But is there an easier way or a library to find this?</strong></p>