[
{
"forums": "",
"resource": {
"dhjName": "myvhp",
"dhj": {
"areaProgramValue": "123",
"areaQuotas": [
{
"areaQuotaValue": "1234",
"name": "acc"
},
{
"areaQuotaValue": "12345",
"name": "pro"
}
],
"methodType": "DGH",
}
},
"task": "create"
},
{
"forums": "",
"resource": {
"dhjName": "myvhp",
"dhj": {
"areaProgramValue": "123",
"areaQuotas": [
{
"areaQuotaValue": "1234",
"name": "acc"
},
{
"areaQuotaValue": "12345",
"name": "pro"
},
{
"areaQuotaValue": "5666"
},
{
"areaQuotaValue": "7666"
}
],
"methodType": "DGH",
}
},
"task": "create"
},
]
面积配额
对他们中的一些人来说
名称
属性不存在。
我已经试过了,如下所示
test = test.filter((obj) => typeof obj.resource.dhj.areaQuotas.name === 'undefined');
这是我的小提琴
https://jsfiddle.net/o2gxgz9r/65225/