Created
September 10, 2017 18:12
-
-
Save Smakar20/6b3fc690470cb3d27cc3deaecd045a93 to your computer and use it in GitHub Desktop.
null created by smakar20 - https://repl.it/KtzF/0
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
//determine if a string has all unique characters. | |
(function isUnique(str){ | |
var charMap ={} | |
var ignoreCaseStr = str.toLowerCase() | |
for(var i=0; i< ignoreCaseStr.length;i++){ | |
if(charMap[ignoreCaseStr[i]] == undefined){ | |
charMap[ignoreCaseStr[i]] = ignoreCaseStr[i] | |
} | |
else{ | |
return false | |
} | |
} | |
return true | |
}('sohIni')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment