Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let input = 'Mi chiedi qual è stato il mio progresso? Ho cominciato a essere amico di me stesso.';
- const vowels = ['a', 'e', 'i', 'o', 'u'];
- let resultArray = [];
- for(i = 0; i < input.length; i++){
- //console.log(i);
- for(j = 0; j < vowels.length; j++){
- if(input[i] === vowels[j]) {
- if(vowels[j] === 'e' || vowels[j] === 'u') {
- resultArray.push(vowels[j] + vowels[j]);
- } else {
- resultArray.push(vowels[j]);
- }
- }
- }
- }
- console.log(resultArray.join('').toUpperCase());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement