Advertisement
Guest User

Untitled

a guest
Aug 25th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. let input = 'Mi chiedi qual è stato il mio progresso? Ho cominciato a essere amico di me stesso.';
  2. const vowels = ['a', 'e', 'i', 'o', 'u'];
  3. let resultArray = [];
  4.  
  5. for(i = 0; i < input.length; i++){
  6. //console.log(i);
  7. for(j = 0; j < vowels.length; j++){
  8. if(input[i] === vowels[j]) {
  9. if(vowels[j] === 'e' || vowels[j] === 'u') {
  10. resultArray.push(vowels[j] + vowels[j]);
  11. } else {
  12. resultArray.push(vowels[j]);
  13. }
  14. }
  15. }
  16. }
  17. console.log(resultArray.join('').toUpperCase());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement