function arrHasvalue(arr) { var nary = ary.sort(); for (var i = 0; i < ary.length; i++) { if (nary[i] == nary[i + 1]) { // console.log("数组重复内容:" + nary[i]); return true; }else{ return false; } } }
var ary = new Array("111", "22", "33", "111");
console.log(arrHasvalue(ary)); //111