JS | Count vowel from a String

const vowel =  (str) => {  count = 0;  for(char of str) {    if('aeiou'.includes(char)) {
count++;
}
}
return count;
}console.log(vowel('hello world')) //3

Keep learning, keep growing!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store