Let's consider an object structured like this:
myObject = {
"a_0" : [{"isGood": true, "parameters": [{...}]}],
"a_1" : [{"isGood": false, "parameters": [{...}]}],
"a_2" : [{"isGood": false, "parameters": [{...}]}],
...
};
The goal is to change all the isGood
values to true
. One attempt involved using _forOwn method to iterate over the object and forEach to loop through each property, but it wasn't successful.
_forOwn(this.editAlertsByType, (key, value) => {
value.forEach(element => {
element.isSelected = false;
});
});
However, an error occurred with the message:
value.forEach is not a function