Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created March 24, 2021 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/9e6ad4637748a1d8f6fbdcc051397733 to your computer and use it in GitHub Desktop.
Save codecademydev/9e6ad4637748a1d8f6fbdcc051397733 to your computer and use it in GitHub Desktop.
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