因为急需,在网上又找不到合适的代码,所以在很短时间内写出来的,难免有bug,望见谅。
var arr1 = [{x:513.4261838440111,y:174},
{x:270.3404255319149,y:174},
{x:513.4261838440111,y:174},
{x:520.5167237931058,y:369.80798782499784},
{x:520.5167237931058,y:369.80798782499784},
{x:241.57929926401988,y:381.9650668601638},
{x:270.3404255319149,y:174},
{x:241.5792992640199,y:381.9650668601638}
]
for (var i = 0; i < arr1.length - 1; i++) {
for (var j = 1; j < arr1.length; j++) {
if (i != j) {
if (arr1[i].x == arr1[j].x && arr1[i].y == arr1[j].y) {
arr1.splice(j, 1)
}
}
}
}