Skip to content

Instantly share code, notes, and snippets.

@jasondscott
Created December 13, 2013 22:54
Show Gist options
  • Save jasondscott/7952844 to your computer and use it in GitHub Desktop.
Save jasondscott/7952844 to your computer and use it in GitHub Desktop.
function allUnique(str) {
var a = [];
for (var i = 0; i < str.length; i++) {
var char = str.charAt(i);
if (!a[char]) {
a[char] = true;
} else {
return false;
}
}
return true;
}
var a = "Jason";
console.log(allUnique(a));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment