Skip to content

Instantly share code, notes, and snippets.

@Smakar20
Created September 10, 2017 18:12
Show Gist options
  • Save Smakar20/6b3fc690470cb3d27cc3deaecd045a93 to your computer and use it in GitHub Desktop.
Save Smakar20/6b3fc690470cb3d27cc3deaecd045a93 to your computer and use it in GitHub Desktop.
null created by smakar20 - https://repl.it/KtzF/0
//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