Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created February 25, 2021 02:16
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/3f7997213b3e7731dcd1ce860dc3a3c7 to your computer and use it in GitHub Desktop.
Save codecademydev/3f7997213b3e7731dcd1ce860dc3a3c7 to your computer and use it in GitHub Desktop.
Codecademy export
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