-
-
Save peterkibuchi/ada1f7c1ae81a56d656be1d157654e99 to your computer and use it in GitHub Desktop.
Codecademy 'Whale Talk' Challenge Project.
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 = []; | |
input = input.toLowerCase(); | |
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