Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created Mar 24, 2021
Embed
What would you like to do?
Codecademy export
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