Count occurrence of a character or expression…
let string = 'How many vowel'
let count = (string.match(/[aeiouy]/g || []).length)
.match() return a array with the match.
However it return null if no match is found. That is why the || [] is necessary.
Otherwise, the .length throw an error.