Sha256: 72bf052092eb9dea908923285055dd229e94ce524a910a18717f5110609306ea
Contents?: true
Size: 396 Bytes
Versions: 255
Compression:
Stored size: 396 Bytes
Contents
var notAlpha = /[^a-z]+/gi, ALPHA_LENGTH = 26, cleaned, unique; var Pangram = function(candidate) { 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
255 entries across 255 versions & 1 rubygems