Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 835 Bytes

disemvowel-trolls.md

File metadata and controls

28 lines (19 loc) · 835 Bytes

Disemvowel Trolls 7 Kyu

LINK TO THE KATA - STRINGS REGULAR EXPRESSIONS FUNDAMENTALS

Description

Trolls are attacking your comment section!

A common way to deal with this situation is to remove all of the vowels from the trolls' comments, neutralizing the threat.

Your task is to write a function that takes a string and return a new string with all vowels removed.

For example, the string "This website is for losers LOL!" would become "Ths wbst s fr lsrs LL!".

Note: for this kata y isn't considered a vowel.

Solution

const disemvowel = str => {
  const regexVowels = /[aeiou]/gi
  return str.replace(regexVowels, '')
}