Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  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());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement