//查看数组中是否包含某元素
Array.prototype.contains = function (obj) {
var i = this.length;
while (i--) {
if (this[i] === obj) {
return true;
}
}
return false;
}
//数组对象去重
Array.prototype.uniqueObject = function (ops) {
var newArr = [];var options={};
for(var i= 0;i < this.length;i++){
if(!options[this[i][ops]]){
options[this[i][ops]] = true;
newArr.push(this[i][ops]);
}
}
return newArr;
}