I want to check if a string has any of the following words, apple, pear, orange and if it does, do some code. However my code only currently checks for the first word, apple and not the other 2. Fruit variable gets sent from a client side.
var fruit = fruit;
if (fruit.includes(["apple", "pear", "orange"])
{
//do some code
}
I tried | instead of a comma
I need it so it checks all for all of the words, not just the first