I want to find some keywords in the table which has arrays in each row

Viewed 22

I am stuck in search situation. if user enter 3 words and I want to use those 3 words in a table where the column(keywords) will have array in each cell. I want to search 3 words in each array in the table where column has array. for example:

words= [ 'women','education'];

I want to search as following:

  1. I want to find those rows where women and education words will find together.
  2. then if women or education can be found.
const findKey = function(keywords, keyword){
  const index = keywords.findIndex(function(word, index){
    return word.keyword.toLowerCase() === keyword.toLowerCase()
  })
  return keywords[index];
}

let printme = findKey(imgKeywords1, 'women');
0 Answers
Related