Manipulating arrays within objects:
-----code -------
var obj1 = { 'a': ['a','b','c','d'], 'b':['b','d','r','a']}
Object.keys(obj1).forEach(element => {
var position = obj1[element].indexOf(element);
if (position !== -1) {
obj1[element].splice(position, 1);
}});
Result: {
"a": [ "c", "d" ],
"b": [ "d","r"]
}