Design comparison
Solution retrospective
I haven't figured a way to make the tags filter work properly, at the minute you can filter the jobs only by one tag. If anyone can help I'd appreciate it.
Community feedback
- @tydusggPosted over 3 years ago
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
0@florinpavel22Posted over 3 years ago@tydusgg Hi, could you explain a bit more in depth how it should work? Like the idea behind it?
0@tydusggPosted over 3 years ago@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.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord