SHARE
TWEET

Untitled

a guest Aug 25th, 2019 36 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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());
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top