I have object like this:
var myObj = {
first: {
sub: {
prop1: "some text",
prop2: "some more text"
},
sub2: {
prop1: "Something",
prop2: "Something2",
}
},
second: {
stuff: "More stuff...lots of stuff"
}
}
I'm trying to remove property from this object by using another object as selector. For example:
var delSeletor = {
first: {
sub: {
prop2: ""
}
}
}
So delete( delSelector, myObject) should return:
var myObj = {
first: {
sub: {
prop1: "some text",
},
sub2: {
prop1: "Something",
prop2: "Something2",
}
},
second: {
stuff: "More stuff...lots of stuff"
}
}
Please note that I'm not looking for solution using the ".dot" selector eg: delete('first.sub.prop2', myObj) like shown in this thread.