var a1 = Number.MAX_VALUE + 100
var a2 = Number.MAX_VALUE * 2
alert(isFinite(a1))//输出true
alert(isFinite(a2))//输出false
可以用for循环比较大小,然后取出最大值。如:
window.onload = function(){var a = [3,0,18,267,99,657,1,6]
var b = a[1]
for(i=0 i<a.lengthi++){
if(b<a[i]){
b = a[i]
}
}
alert(b)
}