Instructions
Create a function called shortcut to remove all the lowercase vowels in a given string.
Examples
"hello" --> "hll"
"codewars" --> "cdwrs"
"goodbye" --> "gdby"
"HELLO" --> "HELLO"
Note: Don't worry about uppercase vowels.
My solution:
function shortcut (string) {
return string.split(/[aeiou]/g).join('')
}
Explanation
I first splitted the string using a RegEx expression, that splitted every vocal from the string, and after that I just joined the array
Comment how would you solve this kata and why? 👇🤔
Top comments (0)