-
-
Save jonathanwork/e0242da811923f50388dba4c6cdb344a to your computer and use it in GitHub Desktop.
this gives results to pangrams
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
//creator Jonathan R. Lopez | |
var write = function(inputString) { | |
process.stdout.write(inputString); | |
} | |
var test = function() { | |
return 'has test' | |
} | |
var checkingAlphabet = function(result) { | |
//var checkResult = !result ? null : result; | |
hasAlphabet = /^[a-z]$/i; | |
if(result.search(hasAlphabet)) { | |
return "pangram"; | |
} else { | |
return "not pangram"; | |
} | |
} | |
//this function loop throgh every char | |
var loopingThroughChar = function(a, fn) { | |
var result = ''; | |
for(var i = 0; i <= a.length; i++) { | |
var removeWhiteSpace = /\s/; | |
result += a.charAt(i).replace(removeWhiteSpace, ''); | |
} | |
//returns a result. | |
var output = fn ? fn(result) : result; | |
write(output); | |
} | |
loopingThroughChar(input,checkingAlphabet); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment