I have an array called 'hello' containing expressions
var hello = ['hi', 'hello', 'yo', 'hey', 'howdy'];
And a string stored in 'usertext' that I get from the user.
I want to check if 'usertext' is containing one of the expressions stored in 'hello' and return true/false, 'usertext' can contain a whole sentence.
So far I tried
if (usertext.includes(hello)) {
var garfieldtext = "Hello. I'm Garfield, what's your name?";
}
I'm sorry if it has already been asked, I didn't find (or understand) the solution out there.
I'm very new to JS