I have this object:
const data = { theValues: [
{key1: "valueOne",
key2: "someValue"},
{key1: "valueTwo",
key2: "moreValue"}]};
If i use the following:
data.theValues = data.theValues.filter(obj => obj.key1 != 'valueOne');
I get this as result:
const data = { theValues: [
{key1: "valueTwo",
key2: "moreValue"}]};
Ok and thats what I wanted too. But if I have the this object:
const data = { theValues: [
{key1: ["valueOne", "valueTwo"],
key2: "otherValue"},
{key1: ["valueThree","valueFour"],
key2: "noValue"}]};
And I use the same thing:
data.theValues = data.theValues.filter(obj => obj.key1 != 'valueOne');
Nothing happens. Why is that and how can I delete the object with the value 'valueOne'?