Skip to content

Instantly share code, notes, and snippets.

@heapwolf
Created June 15, 2010 21:20
Show Gist options
  • Save heapwolf/439754 to your computer and use it in GitHub Desktop.
Save heapwolf/439754 to your computer and use it in GitHub Desktop.
var a = ["A", "B", "A", "C", "A"], b = [], unique;
for(var i=0; i < a.length; i++) {
unique = true;
for(var j=0; j < b.length; j++) {
if(a[i] == b[j]) {
unique = false;
}
}
if(unique) {
b.push(a[i]);
}
}
b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment