Checking for each vowel by traversing the concatenated string
for ( let k = 0 ; k < res . length ; k ++ ) { if ( res [ k ] == ' ' ) vowel [ 0 ] = 1 ; else if ( res [ k ] == ' ' ) vowel [ 1 ] = 1 ; else if ( res [ k ] == ' ' ) vowel [ 2 ] = 1 ; else if ( res [ k ] == ' ' ) vowel [ 3 ] = 1 ; else if ( res [ k ] == ' ' ) vowel [ 4 ] = 1 ; }