{
"1": {
"0": [
7606,
7615,
7596,
7513,
7514,
7597,
7605,
7607,
7608,
7595
],
"87": [
7514,
7605,
7644,
7607,
7608
]
},
"2": {
"0": [
7573,
7605,
7572,
7569
]
},
"3": { ....
}
I have this Following demo Json array . Note - There can be other objects too inside 1
or 2
...
I need to remove the value of the array element which contains any value which matched in a given array [7605,7608,7615,7573]
. I need to remove all these values form the above json array .
How can i recursively traverse the following array and remove all these values from the leaf array of the object .
For the above input the output should be
{
"1": {
"0": [
7606,
7596,
7513,
7514,
7597,
7607,
7595
],
"87": [
7514,
7644,
7607
]
},
"2": {
"0": [
7568,
7572,
7569
]
}
}
I tried using Object.keys but i am confused with the dynamic nature of the json.