Advertisement
Nattack

Untitled

Nov 2nd, 2018
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let input = 'The quick brown fox jumps over the lazy dog.';
  2.  
  3. const vowels = ['a','e','i','o','u'];
  4.  
  5. let resultArray = [];
  6.  
  7. input.split('').forEach( (inElement) => {
  8.   vowels.forEach( (element) => {
  9.     if (inElement === element ) {
  10.             switch(element) {
  11.         case 'e': case 'u':
  12.           resultArray.push(element, element);
  13.           break;
  14.         default:
  15.           resultArray.push(element);
  16.           break;
  17.       }
  18.     }
  19.   });
  20. });
  21.  
  22. console.log(resultArray.join('').toUpperCase());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement