SHARE
TWEET

Untitled

a guest Oct 17th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let input='turpentine and turtles';
  2. const vowels=['a','e','i','o','u'];
  3. var resultArray=[];
  4.  
  5. for(let i=0; i<input.length;i++){
  6.   for(let j=0; j<vowels.length;j++){
  7.       if (input[i]===vowels[j]){
  8.     resultArray.push(input[i]);
  9.       if (input[i]==='e'|| input[i]==='u') {
  10.         resultArray.push(input[i]);
  11.       }
  12.     }
  13.   }
  14. }
  15. 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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top