const arr = [{ i: 1, n: "123"},
{i: 1, n: "123"},
{i: 2, n: "222"},
{i: 2, n: "222"},
{i: 3, n: "333"}
]
// 去重
let obj = {}, newArr = []
for (const key of arr) {if (!obj[key.i]) {obj[key.i] = 1 // 标记反复对象
newArr.push(key)
}
}
console.log(newArr);