Speak Whale
Sun Apr 18 2021 01:14:31 GMT+0000 (Coordinated Universal Time)
Saved by
@David1989
#javascript
let input = "Hi, Human";
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(vowels[j] === input[i]){
if(vowels[j] === 'e'){
resultArray.push('ee');
} else if (vowels[j] === 'u'){
resultArray.push('uu');
} else{
resultArray.push(vowels[j]);
}
}
}
}
console.log(resultArray.join('').toUpperCase());
content_copyCOPY
codecademy
Comments