Has someone an idea how the function have to look like if I want the following results:
In:
{
3: [ "1-2", "4-5" ],
4: [ "1-2", "6-9" ]
}
Out:
{
3: [ "4-5" ],
4: [ "1-2", "6-9" ]
}
I want to remove all duplicate values and leave the last occurrence in the object. If there are no elements left in a property, it should be removed. I tried the suggestions from https://stackoverflow.com/a/9229821/3852382 but it does not solve my problem.