您好,我有一个对象的对象,我需要合并到单个对象中,下面是对象的对象:
{
0: {
CLIENTS_EMAIL: null
}
1: {
CLIENTS_PASSWORD: null
}
2: {
CLIENTS_CONFIRMPASSWORD: null
}
3: {
CLIENTS_FIRSTNAME: null
}
4: {
CLIENTS_LASTNAME: null
}
5: {
CLIENTS_MOBILE: null
}
6: {
CLIENTS_HOMEPHONE: null
}
7: {
CLIENTS_BUSPHONE: null
}
8: {
CLIENTS_RECEIVE_MARKETING_VIA: [
0: {
CLIENTS_ISMARKETINGVIAEMAIL: false
}
1: {
CLIENTS_ISMARKETINGVIAMAIL: false
}
2: {
CLIENTS_ISMARKETINGVIAPHONE: false
}
3: {
CLIENTS_ISMARKETINGVIASMS: false
}
]
}
}
您好,我有一个对象的对象,我需要合并到单个对象中,下面是对象的对象:
{
0: {
CLIENTS_EMAIL: null
}
1: {
CLIENTS_PASSWORD: null
}
2: {
CLIENTS_CONFIRMPASSWORD: null
}
3: {
CLIENTS_FIRSTNAME: null
}
4: {
CLIENTS_LASTNAME: null
}
5: {
CLIENTS_MOBILE: null
}
6: {
CLIENTS_HOMEPHONE: null
}
7: {
CLIENTS_BUSPHONE: null
}
8: {
CLIENTS_RECEIVE_MARKETING_VIA: [
0: {
CLIENTS_ISMARKETINGVIAEMAIL: false
}
1: {
CLIENTS_ISMARKETINGVIAMAIL: false
}
2: {
CLIENTS_ISMARKETINGVIAPHONE: false
}
3: {
CLIENTS_ISMARKETINGVIASMS: false
}
]
}
}
展开片段
需要将其添加到单个对象中,下面是示例:
let data = {
CLIENTS_EMAIL: null,
CLIENTS_PASSWORD: null,
CLIENTS_CONFIRMPASSWORD: null,
CLIENTS_FIRSTNAME: null,
CLIENTS_LASTNAME: null,
CLIENTS_MOBILE: null,
CLIENTS_HOMEPHONE: null,
CLIENTS_BUSPHONE: null,
CLIENTS_ISMARKETINGVIAEMAIL: false,
CLIENTS_ISMARKETINGVIAMAIL: false,
CLIENTS_ISMARKETINGVIAPHONE: false,
CLIENTS_ISMARKETINGVIASMS: false,
}
以下是我正在尝试的逻辑:
const data = Object.entries(Object.entries(object).map((data: any) => {
return data[1]
}))
还查看了其他其他功能,但没有成功
暮色呼如
米脂
相关分类