Excuse me, why is there no way to remove duplicate objects in ES6 Set?

  javascript, question

The code is as follows:

var arr = [1, 3, 19, 3, '3m', '11', '3', 20, {
 name: 'component',
 age: 18
 }, {
 name: 'component',
 age: 18
 function uniq(arr) {
 var tmp = new Set(arr);
 return Array.from(tmp)
 Time ('de-duplication');
 var ret = uniq(arr);
 Timeend ('de-duplication');

The implementation results are as follows:


Personal analysis is: the addresses of the two objects are different, so they are not removed.

When both values are objects, the comparison is whether the two objects point to the same object in memory. This is why{}! =={}Why?