Answers for "js check string for pangram"

0

js check string for pangram

//Detect Pangram
function isPangram(string){
// character set capturing group with negative lookahead
  let regex = /([a-z])(?!.*\1)/gi;
  return (string.match(regex)).length === 26;
}

console.log(isPangram("The quick brown fox jumps over the lazy dog."));// true
console.log(isPangram("This is not a pangram."));// false
console.log(isPangram("Pack my box with five dozen liquor jugs."));// true
Posted by: Guest on March-31-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language