Hi guys. Probably I’m missing something here. The script above works perfectly in the case of a pure string. What I am trying to achieve now is doing the same, but this time check an Array. The list is actually a list of favorites where you find the Array with users uid.
favorites [{“uid":"jTIXVM2nCjVGuih99LJToS2zSZ43”}]
However, something is going wrong and what I see as a result is TypeError: Cannot read property ‘includes’ of undefined. And of course, nothing listed.
I tried
let favorite = JSON.stringify(this.props.likes) and then
let filteredItems = [];
items.forEach(item => {
if (item[favorites].includes(this.props.appActions.dataSlots[‘ds_SlotUserID’])) {
filteredItems.push(item);
}
});
items=filteredItems;
return items;
//
Can you guys please help me here finding the right way to do this?
Best Regards, Marcos