<script type="text/javascript">
if (!Array.prototype.some) {
Array.prototype.some = function (fun/*, thisp*/) {
var i = 0,
len = this.length >>> 0;
if (typeof fun != "function") {
throw new TypeError();
}
var thisp = arguments[1];
for (; i < len; i++) {
if (i in this
&& fun.call(thisp, val, i, this)) {
return true
}
}
return false;
};
}
if (!Array.prototype.every) {
Array.prototype.every = function (fun/*, thisp*/) {
var len = this.length >>> 0;
if (typeof fun != "function") {
throw new TypeError();
}
var thisp = arguments[1];
for (var i=0; i < len; i++) {
if (i in this
&& fun.call(thisp, val, i, this)) {
return false
}
}
return true;
};
}
</script>
您可能感兴趣的文章: