I'm messing around with a vowel counter app, I'm sure there are plenty of different ways to return the same result. I was just curious if you could compare two arrays and return a new array of the matched values? Here's the code of what I was thinking so far. Just not sure if a high order array function could be used here or something else i'm unfamiliar with.
const input = document.querySelector('input');
submitBtn.addEventListener('click', (e) => {
const text = input.value;
const newArray = text.split("");
const vowels = ['a', 'e', 'i', 'o', 'u']
});```