Advertisement
PadmaJS

Untitled

Jan 13th, 2021
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. export const isPangram = (text) => {
  2. let alphabet = "abcdefghijklmnopqrstuvwxyz";
  3. let regex = /\s/g;
  4. let lowercase = text.toLowerCase().replace(regex,"");
  5.  
  6. for(let i = 0; i < alphabet.length; i++){
  7. if(lowercase.indexOf(alphabet[i]) === -1){
  8. return false;
  9. }
  10. }
  11. return true;
  12. };
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement