Last active
November 10, 2016 06:54
-
-
Save jarellano01/f53ac6e2ffd894caf5098bb68a05119d to your computer and use it in GitHub Desktop.
Isogram created by jarellano01 - https://repl.it/ETwe/1
This file contains hidden or 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 isIsogram(str){ | |
| var strLower = str.toLowerCase() | |
| var strArray = strLower.split(""); | |
| var duplicateCheck = []; | |
| for(var i = 0; i < strArray.length; i++){ | |
| if (duplicateCheck.indexOf(strArray[i]) == -1){ | |
| duplicateCheck.push(strArray[i]); | |
| } | |
| else return false | |
| if(strArray[i] == strArray[i+1]){ | |
| return false | |
| } | |
| } | |
| return true; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An isogram is a word that has no repeating letters, consecutive or non-consecutive.