title: JS - Using Set() in Array with Objects
body: <p>How can i use Set() in objects? I read the documentation, it works with values in array, but with objects it do not work. Why? I want to avoid duplicate items that has exacly the same values.</p>
  
  <pre><code>let nameList_one = [{ name: 'harry', id: 1 }, { name: 'john', id: 2 }, { 'name': 'trevor', id: 3  }]
  let nameList_two = [{ name: 'harry', id: 1  }, { name: 'ron', id: 4  }, { name: 'jackson', id: 5  }]
  
  let fullNameList = [...nameList_one , ...nameList_two ]
  
  let filteredList = [...new Set(fullNameList)] // the output is the merge of two array, duplicating "harry".
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <blockquote>
    <p>[{ name: 'harry', id: 1 }, { name: 'john', id: 2 }, { 'name': 'trevor', id: 3  }, { name: 'harry', id: 1  }, { name: 'ron', id: 4  }, { name: 'jackson', id: 5  }]</p>
  </blockquote>
  
  <p><strong>Expected Output:</strong></p>
  
  <blockquote>
    <p>[{ name: 'harry', id: 1 }, { name: 'john', id: 2 }, { 'name': 'trevor', id: 3  }, { name: 'ron', id: 4  }, { name: 'jackson', id: 5  }]</p>
  </blockquote>
  
  <p>Thanks!!</p>