I am checking if a string contains one or more entries from an array, using .some() and .includes() as you can see below.
If the string does include one or more entries from the array, I would like to know which one(s). I haven't found a way to achieve this so far.
Here is my code:
var hobby = ["sport","art","music"];
var message = "I love sport!";
if(hobby.some(el => message.includes(el))){
console.log("a hobby is included");
// tell me which hobby or hobbies here
}