pangram.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var Pangram = function(text) {
  var alphabet = "abcdefghijklmnopqrstuvwxyz";

  text = text.toLowerCase();

  this.isPangram = function() {
    var i = text.length;
    while (i-- && alphabet.length > 0) {
      alphabet = alphabet.replace(text[i], '');
    }
    return alphabet.length === 0;
  };
};


module.exports = Pangram;

Comments


You're not logged in right now. Please login via GitHub to comment