I want to filter array if it contains a particular string. It works as shown below. But I am not sure how to solve it if there are multiple strings to match. For example - instead of skillText = "Entry Level";
if we have skillText = ["Entry Level", "Scientist", "Analyst"];
var myList = [{"Title":"Entry Level - Data Analyst","Location":"Boston"}, {"Title":"Entry Level3 - Analyst","Location":"Delhi"}, {"Title":"Scientist","Location":"Boston"}];
skillText = "Entry Level";
result = myList.filter(function(v) {
return v["Title"].indexOf(skillText) > -1;
})
console.log(result);
For exact match skillText.includes(v["Title"])
works but not sure how to do with partial matches.