Program to accept a Strings which contains all the Vowels | Function to to check that a string contains all vowels ; Hash Array of size 5 such that the index 0 , 1 , 2 , 3 and 4 represent the vowels a , e , i , o and u ; Loop the string to mark the vowels which are present ; Loop to check if there is any vowel which is not present in the string ; Function to to check that a string contains all vowels ; Driver Code
function checkIfAllVowels ( str ) { var hash = Array ( 5 ) . fill ( 0 ) ; for ( var i = 0 ; i < str . length ; i ++ ) { if ( str [ i ] == ' ' str [ i ] == ' ' ) hash [ 0 ] = 1 ; else if ( str [ i ] == ' ' str [ i ] == ' ' ) hash [ 1 ] = 1 ; else if ( str [ i ] == ' ' str [ i ] == ' ' ) hash [ 2 ] = 1 ; else if ( str [ i ] == ' ' str [ i ] == ' ' ) hash [ 3 ] = 1 ; else if ( str [ i ] == ' ' str [ i ] == ' ' ) hash [ 4 ] = 1 ; } for ( var i = 0 ; i < 5 ; i ++ ) { if ( hash [ i ] == 0 ) { return 1 ; } } return 0 ; } function checkIfAllVowelsArePresent ( str ) { if ( checkIfAllVowels ( str ) ) document . write ( " " ) ; else document . write ( " " ) ; } var str = " " ; checkIfAllVowelsArePresent ( str ) ;