-
-
Save codecademydev/56160540143c183ce56a89e528b6c685 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let input = 'a whale of a deal!'; | |
const vowels = ['a', 'e', 'i', 'o', 'u']; | |
let resultArray = []; | |
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'){ | |
resultArray.push('ee') | |
} | |
else if(input[i] === 'u'){ | |
resultArray.push('uu') | |
} | |
else{ | |
resultArray.push(input[i]) | |
} | |
} | |
} | |
} | |
console.log(resultArray.join('').toUpperCase()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment