DEV Community

Madalina Pastiu
Madalina Pastiu

Posted on

Disemvowel Trolls

Instructions:
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.

Thoughts:
Using the replace() method with a regular expression (/[aeiouAEIOU]/g) to match all vowels and replacing all matched vowels with an empty string to effectively remove them.

Solution
Tests

This is a CodeWars Challenge of 7kyu Rank (https://www.codewars.com/kata/52fba66badcd10859f00097e/train/javascript)

Heroku

Deploy with ease. Manage efficiently. Scale faster.

Leave the infrastructure headaches to us, while you focus on pushing boundaries, realizing your vision, and making a lasting impression on your users.

Get Started

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More