Skip to content
Prev Previous commit
Next Next commit
docs: add comments of workable code
  • Loading branch information
fahimfaisaal committed Feb 27, 2022
commit cd448cad8b2e67d8f1eb97785e5d47c834cf2b99
8 changes: 8 additions & 0 deletions String/CheckPangram.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ const checkPangram = (string) => {
throw new TypeError('The given value is not a string')
}

/**
* match all 26 alphabets using regex, with the help of:
* Capturing Group
* Character set
* Negative lookahead
* Dot & star
* Numeric reference
*/
return string.match(/([a-z])(?!.*\1)/gi).length === 26
}

Expand Down