给数组对象增添contains方法:是否包某一对象

给数组对象添加contains方法:是否包某一对象
        //数组是否存在某一对象
Array.prototype.contains = function(obj) {
this.obj = obj;
var that = this;
function isExist() {
for (var i = 0, j = that.length; i < j; i++) {
if (that[i] == obj) {
return true;
}
}
return false;
}
return isExist();
}