Shorter way to write multiple "or"-conditions in if-statement
javascript
Solution
You can do this with regex:
var checkVowel = function(input) {
return /^[aeiou]$/.test(input);
};
Or using `indexOf` with an array:
var checkVowel = function(input) {
return ['a','e','i','o','u'].indexOf(input) > -1;
};
Problem
I just started learning JavaScript a few days ago and I am wondering: ``` var input = prompt(); var checkVowel = function (input) { if (input === "a" || input === "e" || input === "i" || input === "o" || input === "u") { return true; } else { return false; } } checkVowel(input); ``` Isn't there a shorter way to write the multiple inputs instead of `input === "e"` each time?