DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cesar Del rio
Cesar Del rio

Posted on • Updated on

#11 - Vowel remover CodeWars Kata (8 kyu)

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('')
}

Enter fullscreen mode Exit fullscreen mode

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? πŸ‘‡πŸ€”

My Github
My twitter
Solve this Kata

Top comments (0)

5 Websites To Learn Frontend Web Development Faster

In this article, Bentil Shadrack has curated 5 resourceful sites that will help you better you web development skills really fast.