I have set lists
example:
const answerList = [{index: 2, answer: nice}, {index: 5, answer: sunday} ...]
like that
and I have a sentence
example:
"hi i'm theo nice to meet you. how are you"
so I want to check if there is a correct answer in the sentence and if find it, return answerList set
example:
return value is [{index: 2, answer: nice}]
Because there is the word "nice" in the sentence.
Can someone tell me a good way?