I have the following code:
let filteredArray = data
.filter((object) =>
isFilterInArray(filterBy, Object.values(object))
)
.forEach((object) => {
Object.keys(object).forEach((key) => {
object[key] = markHighlightedText(filterBy, object[key]);
});
});
It should be filtering initially the items that an array contains based on a filterBy value.
Once I filter it, I'm trying to modify each value and do some stuff, but then the
object[key] = markHighlightedText(filterBy, object[key]);
is failing with the following error:
Why is this wrong?
