重要的事说三遍
proxy.$_ 是 loadsh
proxy.$_ 是 loadsh
proxy.$_ 是 loadsh
const checkDuplicateProperties = (array)=> {
let duplicateProperties = {};
let uniqueProperties = {};
proxy.$_.forEach(array, function(item) {
proxy.$_.forEach(item, function(value, key) {
uniqueProperties[key] = uniqueProperties[key] || []
if (value && uniqueProperties[key].includes(value)) {
duplicateProperties[key] = value;
} else {
uniqueProperties[key].push(value)
}
});
});
return duplicateProperties;
}
let obj = checkDuplicateProperties([{name: 1,num:2},{name: 1,num:2}])
conslog.log({name:1, num:2})