I am trying to filter based on multiple values and only if they are not empty. Example:
jobsTracked = [
{
"company": "Company1",
"position": "Senior Frontend Developer",
"role": "Frontend",
"level": "Senior",
},
{
"company": "Company2",
"position": "Senior Frontend Developer",
"role": "Frontend",
"level": "Senior",
}]
I am trying to filter by 3 values in this example: position, role, level. And if position is empty string then i dont want to filter it but still want to filter by role and level if they arent empty string. And vice versa for all of them. Can the JavaScript filter function do this?