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());
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter