Created
August 14, 2018 00:01
-
-
Save Samuelachema/0ec85b980807f5a7932bf1bcb9753f06 to your computer and use it in GitHub Desktop.
Create a method isIsogram that takes one argument, a word to test if it's an isogram. This method should return a boolean indicating whether it is an isogram. If the argument supplied is an empty string, return False.
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 isIsogram(word){ | |
if (word !== undefined){ | |
const wordArr = word; | |
if(word === ""){ | |
return false; | |
} | |
for (let i = 0; i < wordArr.length; i++) { | |
for (let j = 0; j < wordArr.length; j++) { | |
if(i!=j){ | |
if (wordArr[i] == wordArr[j]) { | |
return false | |
} | |
} | |
} | |
} | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment