Last active
December 10, 2015 23:08
-
-
Save lanqy/4507603 to your computer and use it in GitHub Desktop.
判断数组值唯一
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
_unique: function (arr) { //判断数组值唯一 | |
var i,len = arr.length,a = [],o = {}; | |
for (i = 0; i < len; i++) { | |
o[arr[i]] = 0; | |
} | |
for (i in o) { | |
a.push(i); | |
} | |
return a; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment