@tydusgg
Posted
I have an idea how to realize multiple filter.
let arr = [
{
// some stuff
skills: ["JavaScript", "HTML", ......]
},
{.......}
];
let filter = ["HTML" "CSS"];
function filterArray(arr, filter){
return arr.filter( item => filter.every(field => item.skills.includes(field) ) )
};
And i think you might render array items in JS, not in static HTML.
Good luck :3
@florinpavel22
Posted
@tydusgg Hi, could you explain a bit more in depth how it should work? Like the idea behind it?
@tydusgg
Posted
@florinpavel22 You have an array of jobs as objects, they contain skills array. If filter is empty, then function returns all items, if filter contains atleast one field, then function returns filtered array.
My function needs to be expanded a bit, but idea is something like this.