Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created February 4, 2021 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save codecademydev/56160540143c183ce56a89e528b6c685 to your computer and use it in GitHub Desktop.
Save codecademydev/56160540143c183ce56a89e528b6c685 to your computer and use it in GitHub Desktop.
Codecademy export
let input = 'a whale of a deal!';
const vowels = ['a', 'e', 'i', 'o', 'u'];
let resultArray = [];
for(let i = 0; i < input.length; i++){
for(let j = 0; j < vowels.length; j++){
if(input[i] === vowels[j]){
if(input[i] === 'e'){
resultArray.push('ee')
}
else if(input[i] === 'u'){
resultArray.push('uu')
}
else{
resultArray.push(input[i])
}
}
}
}
console.log(resultArray.join('').toUpperCase());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment