function getSpecialData(name, obj) {
let values = Object.values(name)
// console.log('values', values)
values.unshift(obj);
let res = {};
let keys = Object.keys(obj);
keys.forEach((item) => {
res[item] = [];
});
values.forEach((item, index) => {
let values = Object.values(item);
let isEqual = values.every((ytem) => ytem === "");
if (!isEqual) {
keys.forEach((ytem) => {
item[ytem] === "" ? res[ytem].push("") : res[ytem].push(item[ytem]);
});
}
});
return res;
}
let obj = { aaa: { name: "李四" }, bbb: { name: "张三" }, ff: { name: "王五" } }
let { name } = getSpecialData(obj, {
name: obj,
});
console.log('name', name)
console