Sha256: a0a8b6a6ad6771f56498b31bff8846399fdbdac9351fe724a31f8fd4a5a0b046

Contents?: true

Size: 412 Bytes

Versions: 105

Compression:

Stored size: 412 Bytes

Contents

var Pangram = function (candidate) {
  var notAlpha = /[^a-z]+/gi;
  var ALPHA_LENGTH = 26;
  var cleaned;
  var unique;

  unique = {};
  cleaned = (candidate.replace(notAlpha, '')).toLowerCase();
  cleaned.split('').forEach(function (el) {
    unique[el] = true;
  });

  return {
    isPangram: function () {
      return Object.keys(unique).length === ALPHA_LENGTH;
    }
  };
};

module.exports = Pangram;

Version data entries

105 entries across 105 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.179 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.178 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.177 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.176 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.175 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.174 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.173 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.172 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.171 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.170 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.169 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.167 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.166 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.165 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.164 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.163 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.162 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.161 tracks/javascript/exercises/pangram/example.js
trackler-2.2.1.160 tracks/javascript/exercises/pangram/example.js