I'm a software engineer working as a full-stack developer using JavaScript, Node.js, and React. I write about my experiences in tech, tutorials, and share helpful hints.
/**
* Count the number of vowels in the input and return an integer.
*/functioncountVowels(inputText){// Create a regular expression that matches vowels. Look for all matches (g flag) and ignore case (i flag).constvowelRegularExpression=/[aeiou]/gi// Convert the input text to lower case and find the matches.constvowelMatches=inputText.match(vowelRegularExpression)// If there are matches, return the length of the match array. Otherwise, there were no matches, so return 0.return(vowelMatches?vowelMatches.length:0)}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here is my try at it in JavaScript: