我需要确定数组中是否存在值.
我使用以下功能:
Array.prototype.contains = function(obj) {
    var i = this.length;
    while (i--) {
        if (this[i] == obj) {
            return true;
        }
    }
    return false;
}
上面的函数总是返回false.
数组值和函数调用如下:
arrValues = ["Sam","Great", "Sample", "High"]
alert(arrValues.contains("Sam"));