Skip to content

Instantly share code, notes, and snippets.

@ckahle33
Created March 25, 2016 20:01
Show Gist options
  • Save ckahle33/367e0470559da6db5b90 to your computer and use it in GitHub Desktop.
Save ckahle33/367e0470559da6db5b90 to your computer and use it in GitHub Desktop.
Pangram test
function processData(input) {
var alpha = 'abcdefghijklmnopqrstuvwxyz'.split('')
var inputArr = input.split('');
var countArr = []
inputArr.forEach(function(i){
i = i.toLowerCase();
if (alpha.indexOf(i) >= 0 && countArr.indexOf(i) === -1 ) {
countArr.push(i);
}
});
countArr.length >= alpha.length ? console.log('pangram') : console.log('not pangram');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment