1.
Array.prototype.contains = function (element) {
for (var i = 0; i < this.length; i++) {
if (this[i] == element) {
return true;
}
}
return false;
}
2.
Array.prototype.contains = function(obj) {
var i = this.length;
while (i–) {
if (this[i] === obj) {
return true;
}
}
return false;
}
3.我是用这个实现的
json1.push(vipStatus);
[color=red]Array.prototype.contains = function(item){
return RegExp(item).test(this); }[/color]
if(json1.contains('无效')){
return ture;
}else{
return false
}
Array.prototype.contains = function (element) {
for (var i = 0; i < this.length; i++) {
if (this[i] == element) {
return true;
}
}
return false;
}
2.
Array.prototype.contains = function(obj) {
var i = this.length;
while (i–) {
if (this[i] === obj) {
return true;
}
}
return false;
}
3.我是用这个实现的
json1.push(vipStatus);
[color=red]Array.prototype.contains = function(item){
return RegExp(item).test(this); }[/color]
if(json1.contains('无效')){
return ture;
}else{
return false
}