我有数组对象,我想删除一些内部对象如果密钥不匹配。如何筛选对象通过检查关键
输入:
"configuration" : {
"11111-2222-3333-444--5555" : {
"home1" :
{
"tel" : "125",
"address" : true,
}
},
"2222-3333-44444-5555--66666" : {
"home2" :
{
"tel" : "125",
"address" : true,
}
}
}
我有一个匹配的字符串11111-2222-3333-444--5555
预期了:
"configuration" : {
"11111-2222-3333-444--5555" : {
"home1" :
{
"tel" : "125",
"address" : true
}
}
}
它不是对象的数组。它只是一个有多个键的对象。 –
你试过了什么? –
可能的重复 - https://stackoverflow.com/questions/38750705/using-es6-to-filter-object-properties – Rastalamm