I'm interested in figuring out how to identify strings within one array that are similar to strings in another array using JavaScript.
I currently have code that finds an exact match like this:
var arr = ['English Question Answering', 'Questions And Reviews Organic Milk', 'Facebook Page Discovery (En) - 1426357'];
var keyword = ['English Question Answering', 'Facebook Page Discovery (En)']
var ret = []
arr.forEach(val => {
if (keyword.includes(val[1])) {
ret.push(`*${val[0]}* - ***${val[1]}*** - Pay: *${val[3]}* - tasks: *${val[5]}*`)
}
})
Now, I am trying to make it work for approximate matches by having:
var arr = ['English Question Answering', 'Questions And Reviews Organic Milk', 'Facebook Page Discovery (En) - 1426357'];
var keyword = ['English Question Answering', 'Facebook Page Discovery (En)'];
The expected outcome would be:
['English Question Answering', 'Facebook Page Discovery (En) - 1426357'];