We're a place where coders share, stay up-to-date and grow their careers.
import { compose } from 'crocks'; const toLowerCase = s => s.toLowerCase(); const spread = s => [...s]; const length = xs => xs.length; const included = xs => x => xs.includes(x); const filter = p => xs => xs.filter(p); const charIncludesCount = chars => compose( length, filter(included(toLowerCase(chars)), spread, toLowerCase ); const vowelCount = charIncludesCount ('aeiou');
Discussion on: Daily Challenge #3 - Vowel Counter