showing results for - "js check string for pangram"
Zak
06 Apr 2017
1//Detect Pangram
2function isPangram(string){
3// character set capturing group with negative lookahead
4  let regex = /([a-z])(?!.*\1)/gi;
5  return (string.match(regex)).length === 26;
6}
7
8console.log(isPangram("The quick brown fox jumps over the lazy dog."));// true
9console.log(isPangram("This is not a pangram."));// false
10console.log(isPangram("Pack my box with five dozen liquor jugs."));// true