-
-
Save codecademydev/3f7997213b3e7731dcd1ce860dc3a3c7 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 = 'I just keep moving forward.'; | |
const vowels = ['a', 'e', 'i', 'o', 'u']; | |
let resultArray = []; | |
for (let i = 0; i < input.length; i++) { | |
// console.log(i); | |
for (j = 0; j < vowels.length; j++) { | |
// console.log(j); | |
if (input[i] === vowels[j]) { | |
resultArray.push(vowels[j].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