Created
March 25, 2016 20:01
-
-
Save ckahle33/367e0470559da6db5b90 to your computer and use it in GitHub Desktop.
Pangram test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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