🐧 Linux TippsDebian 11 Long Term Support reaches end-of-life(31.08.2026 um 02:00 Uhr)
🐧 Linux TippsUpdated Debian 13: 13.7 released(12.09.2026 um 02:00 Uhr)
🕵️ SicherheitslückenUSN-8741-1: Flatpak vulnerabilities(10.09.2026 um 10:44 Uhr)
🕵️ SicherheitslückenUSN-8742-1: Netty vulnerability(10.09.2026 um 11:01 Uhr)
🕵️ SicherheitslückenUSN-8737-2: GNU C Library vulnerabilities(10.09.2026 um 13:25 Uhr)
🕵️ SicherheitslückenUSN-8743-1: PHP vulnerabilities(10.09.2026 um 13:48 Uhr)
🕵️ SicherheitslückenUSN-8744-1: Python vulnerabilities(10.09.2026 um 15:53 Uhr)
🐧 Linux TippsUSN-8748-1: Linux kernel (NVIDIA) vulnerabilities(10.09.2026 um 17:32 Uhr)
🕵️ SicherheitslückenUSN-8745-1: KissFFT vulnerabilities(10.09.2026 um 17:36 Uhr)
🕵️ SicherheitslückenUSN-8746-1: libEBML vulnerability(10.09.2026 um 17:48 Uhr)
🐧 Linux TippsDebian 11 Long Term Support reaches end-of-life(31.08.2026 um 02:00 Uhr)
🐧 Linux TippsUpdated Debian 13: 13.7 released(12.09.2026 um 02:00 Uhr)
🕵️ SicherheitslückenUSN-8741-1: Flatpak vulnerabilities(10.09.2026 um 10:44 Uhr)
🕵️ SicherheitslückenUSN-8742-1: Netty vulnerability(10.09.2026 um 11:01 Uhr)
🕵️ SicherheitslückenUSN-8737-2: GNU C Library vulnerabilities(10.09.2026 um 13:25 Uhr)
🕵️ SicherheitslückenUSN-8743-1: PHP vulnerabilities(10.09.2026 um 13:48 Uhr)
🕵️ SicherheitslückenUSN-8744-1: Python vulnerabilities(10.09.2026 um 15:53 Uhr)
🐧 Linux TippsUSN-8748-1: Linux kernel (NVIDIA) vulnerabilities(10.09.2026 um 17:32 Uhr)
🕵️ SicherheitslückenUSN-8745-1: KissFFT vulnerabilities(10.09.2026 um 17:36 Uhr)
🕵️ SicherheitslückenUSN-8746-1: libEBML vulnerability(10.09.2026 um 17:48 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 3 Min Lesezeit
0

My React Journey: Day 6

↗ Quelle (dev.to)
🗣️ Stimme:

Today was all about practice, and I decided to challenge myself on Codewars. It was an exciting experience solving coding exercises, particularly one titled "Disemvowel Trolls". Here's how it went:



Challenge Title: Disemvowel Trolls

Instruction

Trolls are attacking your comment section! To neutralize the threat, remove all the vowels from the trolls' comments.



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



Example

Input: "This website is for losers LOL!"

Output: "Ths wbst s fr lsrs LL!"



Note: For this kata, the letter y is not considered a vowel.



Solution

Here’s the solution I came up with:




CODE
function disemvowel(str) {
const vowels = ['a', 'e', 'i', 'o', 'u']; // List of vowels
let container = ""; // To store characters that are not vowels

for (let i = 0; i < str.length; i++) {
if (!vowels.includes(str[i].toLowerCase())) {
container += str[i]; // Add non-vowel characters to the container
}
}
return container; // Return the string without vowels
}






Explanation

Define Vowels

I created a variable vowels that holds an array of all vowels: ['a', 'e', 'i', 'o', 'u']. This is the reference point for determining if a character is a vowel or not.



Initialize a Container

A container variable is used to collect all characters that are not vowels.



Iterate Through the String

Using a for loop, I iterated through each character of the input string (str).



Check for Vowels

For each character, I converted it to lowercase (str[i].toLowerCase()) to make the check case-insensitive. I used the .includes() method to verify if the character is a vowel.



Add Non-Vowels to Container

If the character is not a vowel, it gets appended to the container.



Return Result

After the loop finishes, the container contains the string with all vowels removed, and it is returned as the output.



Key Insights

I realized the importance of handling case sensitivity when processing strings. Converting characters to lowercase ensures consistent comparisons.

Using arrays and methods like .includes() makes checking for specific conditions (like whether a character is a vowel) much simpler and cleaner.



console.log(disemvowel("This website is for losers LOL!"));

// Output: "Ths wbst s fr lsrs LL!"





CODE
console.log(disemvowel("Hello World!"));
// Output: "Hll Wrld!"






Reflections

This exercise reinforced the importance of problem-solving skills in programming. Breaking down the challenge into smaller steps made it much easier to tackle.



I’m excited to dive into more challenges tomorrow.



Day 7, here I come! 🚀

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Debian 11 Long Term Support reaches end-of-life
1 Quelle
Updated Debian 13: 13.7 released
1 Quelle
USN-8741-1: Flatpak vulnerabilities
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten My React Journey: Day 6

Thematisch verwandte Begriffe: React, Journey · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...