I\'m supposed to write a function that takes a character (i.e. a string of length 1) and returns true if it is a vowel, false otherwise. I came up with two functions, but do
I created a simplified version using Array.prototype.includes(). My technique is similar to @Kunle Babatunde.
const isVowel = (char) => ["a", "e", "i", "o", "u"].includes(char); console.log(isVowel("o"), isVowel("s"));