Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript Count The Number Of Vowels In A String

//Example of the solution to finding all the vowels within a string

function countAllTheVowels(string) { 

    //Finding all of the vowels
    const numberOfVowels = string.match(/[aeiou]/gi).length;

    //Returning the result
    return numberOfVowels;
}
 
PREVIOUS NEXT
Tagged: #JavaScript #Count #The #Number #Of #Vowels #In #A #String
ADD COMMENT
Topic
Name
2+6 =