title: Comparing arrays of objects and remove duplicate
body: <p>I have <strong>an array containing arrays of objects</strong> which I need to compare.</p>
  
  <p><em>I've looked through multiple similar threads, but I couldn't find a proper one that compares <strong>multiple</strong> arrays of objects (most are comparing two arrays of objects or just comparing the objects within a single array)</em></p>
  
  <p>This is the data (below is a JSFiddle with code sample)</p>
  
  <pre><code>const data = [  
    [  
      {  
        "id": "65",
        "name": "Some object name",
        "value": 90
      },
      {  
        "id": "89",
        "name": "Second Item",
        "value": 20
      }
    ],
    [  
      {  
        "id": "89",
        "name": "Second Item",
        "value": 20
      },
      {  
        "id": "65",
        "name": "Some object name",
        "value": 90
      }
    ],
    [  
      {  
        "id": "14",
        "name": "Third one",
        "value": 10
      }
    ]
  ]
  </code></pre>
  
  <p>I want to <strong>remove all duplicate arrays of objects</strong>, regardless of the length of <code>data</code> (there could be a lot more records).</p>
  
  <p>I managed to get the unique ones extracted into an object:</p>
  
  <pre><code>const unique = data.reduce(function(result, obj) {
      return Object.assign(result, obj)
  }, [])
  </code></pre>
  
  <p>That doesn't work for me though, because I need 1 of the duplicated arrays to remain and the returned data to be an array as well, instead of an object. E.g.:</p>
  
  <pre><code>// result I need
  [  
    [  
      {  
        "id":"65",
        "name":"Some object name",
        "value":90
      },
      {  
        "id":"89",
        "name":"Second Item",
        "value":20
      }
    ],
    [  
      {  
        "id":"14",
        "name":"Third one",
        "value":10
      }
    ]
  ]
  </code></pre>
  
  <p>So how do I compare each array of objects to the others in the parent array and preserve one of each duplicated or unique array of objects?</p>
  
  <p><a href="https://jsfiddle.net/fztu0aL0/" rel="nofollow noreferrer">JSFiddle</a></p>