Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let input = 'The quick brown fox jumps over the lazy dog.';
- const vowels = ['a','e','i','o','u'];
- let resultArray = [];
- input.split('').forEach( (inElement) => {
- vowels.forEach( (element) => {
- if (inElement === element ) {
- switch(element) {
- case 'e': case 'u':
- resultArray.push(element, element);
- break;
- default:
- resultArray.push(element);
- break;
- }
- }
- });
- });
- console.log(resultArray.join('').toUpperCase());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement