Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let input='turpentine and turtles';
- const vowels = ['a','e','i','o','u'];
- let resultArray = [];
- let resultString = [];
- for(let i = 0; i<input.length; i++)
- {
- for(let j = 0; j<vowels.length;j++)
- {
- if(input[i]===vowels[j])
- {
- if(input[i]==='e' || input[i] ==='u')
- {
- resultArray.push(input[i]);
- resultArray.push(input[i]);
- }
- else resultArray.push(input[i]);
- }
- }
- //console.log(i);
- }
- for(let i = 0; i<resultArray.length;i++)
- {
- console.log(resultArray[i]);
- }
- resultString = resultArray;
- console.log(resultString.join("").toUpperCase());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement