Created
March 6, 2020 15:41
-
-
Save emmabostian/305970938c972c7b1284654a7234967e to your computer and use it in GitHub Desktop.
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) { | |
// Turn string into array w/ lowercase letters | |
let arr = str.toLowerCase().split(''); | |
// Create a set out of the array we just made | |
let set = new Set(arr); | |
// If the set and array have the same length, it's an isogram | |
return set.size === arr.length; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment