#Can someone help me with this filtering bug, newbi having issues with debugging
5 messages · Page 1 of 1 (latest)
A better filter than hoping it's the 2nd class, just use contains https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/contains
function filterFunction ({ target }) {
const filteredItems = items.filter(({ category }) => target.classList.contains(category));
This is what i am reading now, because of course in a real life thing no garentee class will be indexed[1]
the issue was naming, this is a quality of life improvement
thank you, such a stupid mistake, i was thinking it was name related but could not spot it, and yes i need to improve, the saying is like, you dont learn by doing shit correct :), anyway thank you for the help so embarrassed i didnt spot it myself