let arr1 = ['a', 'a', 'b'];
let p1 = {name: 'Peter', age: 21};
let p2 = {name: 'James', age: 23};
let p3 = {name: 'James', age: 23};
let arr2 = [p1, p2, p3];
let set1 = new Set([...arr1]);
let set2 = new Set([...arr2]);
console.log(set1);
console.log(set2);