Created
March 15, 2013 16:06
-
-
Save stugoo/5171003 to your computer and use it in GitHub Desktop.
remove duplicates
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
function eliminateDuplicates(arr) { | |
var i, | |
len=arr.length, | |
out=[], | |
obj={}; | |
for (i=0;i<len;i++) { | |
obj[arr[i]]=0; | |
} | |
for (i in obj) { | |
out.push(i); | |
} | |
return out; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment