objDeleteKeyByValue 

Deletes keys equal to the given value from the object data. If the recursive option is true, also deletes all keys corresponding to the same value in the child items.
Parameters
| Name | Type | Required | Default |
|---|---|---|---|
obj | object | ● | – |
searchValue | string | number | null | – | – |
recursive![]() named | boolean | – | false |

named parameters are passed as named parameters in Dart and keyword arguments in Python.
Returns
object|null
Examples
javascript
const result = objDeleteKeyByValue(
{
a: 1,
b: 2,
c: {
aa: 2,
bb: {
aaa: 1,
bbb: 2
}
},
d: {
aa: 2
}
},
2,
true
);
console.log(result); // Returns { a: 1, c: { bb: { aaa: 1 } }, d: {} }dart
print(objDeleteKeyByValue(
{
'a': 1,
'b': 2,
'c': {
'aa': 2,
'bb': {
'aaa': 1,
'bbb': 2
}
},
'd': {
'aa': 2
}
},
2,
recursive: true
));
// Returns { 'a': 1, 'c': { 'bb': { 'aaa': 1 } }, 'd': {} }python
result = objDeleteKeyByValue(
{
'a': 1,
'b': 2,
'c': {
'aa': 2,
'bb': {
'aaa': 1,
'bbb': 2
}
},
'd': {
'aa': 2
}
},
2,
True
)
print(result) # Returns { 'a': 1, 'c': { 'bb': { 'aaa': 1 } }, 'd': {} }