Program to count vowels in a string ( Iterative and Recursive ) | Function to check the Vowel ; Returns count of vowels in str ; Check for vowel ; string object ; Total numbers of Vowel
function isVowel ( ch ) { ch = ch . toUpperCase ( ) ; return ch == " " || ch == " " || ch == " " || ch == " " || ch == " " ; } function countVowels ( str ) { var count = 0 ; for ( var i = 0 ; i < str . length ; i ++ ) if ( isVowel ( str [ i ] ) ) ++ count ; return count ; } var str = " " ; document . write ( countVowels ( str ) ) ; document . write ( " " ) ;