Skip to content

Instantly share code, notes, and snippets.

@lanqy
Last active December 10, 2015 23:08
Show Gist options
  • Save lanqy/4507603 to your computer and use it in GitHub Desktop.
Save lanqy/4507603 to your computer and use it in GitHub Desktop.
判断数组值唯一
_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