let arr = [ { name:'censek', age: 18 }, { name: 'bob', age: 13 }, { name: 'john', age: 25 }, { name: 'censek', age: 6 }];for (i = 0; i < arr.length - 1; i++) { for (j = i + 1; j < arr.length; j++) { if (arr[i].name === arr[j].name) { console.log("重名了!!"); } }}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)