DEV Community

Discussion on: Daily Challenge #3 - Vowel Counter

Collapse
 
gnsp profile image
Ganesh Prasad
const test = require('./tester');
const vowelCount = str => String(str)
    .toLowerCase()
    .split('')
    .filter(ch => 'aeiou'.indexOf(ch) > -1)
    .length;

test(vowelCount, [
    {
        in: ["Hello O'Henry !"],
        out: 4,
    },
    {
        in: ['gnsp'],
        out: 0
    }
]);