I am trying to remove duplicate form list of arrays that are present in an object and object looks like bellow , for example i am only using two array but there are many in actual array that i am looking at
{
"NAME":[
"LORD",
"OF",
"RINGS",
"LORD"
],
"ADRESS":[
"INDIA",
"INDIA",
"TEXAS",
"SRILANKA"
]
}
Expected output :
{
"NAME":[
"LORD",
"OF",
"RINGS"
],
"ADRESS":[
"INDIA",
"TEXAS",
"SRILANKA"
]
}
Currently I am able to pull out a single array from object and am able to remove duplicates using "SET" bellow is my code
console.log("without duplicates", [... new Set(r.NAME)]);
Since it is an object i am sure i cant loop on this. How can i achieve the expected output , Thanks