I have a problem filtering the data array. I have two arrays: families and children. And I can't figure out how I could filter the array according to the age field in the children's array. I already translate:
The common thing between these data arrays is the family_id field.
My code looks like this:
filterProductsByYear: function(families) {
return families.filter(
family => family.family_id.includes(this.children.family_id)
);
},
And how could I filter a families array of data by the age of children array about the children_year field?
I wonder if adding a where clause in this includes make sense, I thought it was the best idea, but I don't know how can I do it.