-
-
Save codecademydev/9e6ad4637748a1d8f6fbdcc051397733 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
const inputNew = 'bEttEr to rEmain silEnt and thought a fool than to spEak and rEmovE all doubt'; | |
let input = inputNew.toLowerCase(); | |
const vowels = ['a', 'e', 'i', 'o', 'u', ]; | |
let resultArray = []; | |
for (i = 0; i < input.length; i++) { | |
for (j = 0; j < vowels.length; j++){ | |
if (input[i] === vowels[j]) { | |
resultArray.push(input[i].toUpperCase()); | |
} | |
} | |
if (input[i] === 'e' || input[i] === 'u') { | |
resultArray.push(input[i].toUpperCase()); | |
} | |
} | |
console.log(resultArray.join('')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment