Reading List

Pangram validator in one line from Christian Heilmann RSS feed.

Pangram validator in one line

For a quiz, I am playing with Pangrams, sentences that have all 26 letters of the alphabet in them. Using Set and some RegEx it is a one-liner in JavaScript to validate them (split into two lines for readability…). const isPangram = s => new Set( s.toLowerCase().replace(/[^a-z]/g, ‘’) ).size === 26; I’ve also put together […]