Array.prototype.check_array=function(e){
for(i=0;i<this.length&&this[i]!=e;i++);
return!(i==this.length);//contains:trueorfalse
};
调用:
vartsh=('1','10','11');
if(!tsh.check_array('5')){//iftshnotcontains‘5’
··············································
}