Math.min()虽然能取到最小值,但是不支持数组。所以可以用Math.min.apply(null,arr)来获取数组中的最小值。
<script>
alert(Math.min.apply(null,arr));//获取数组中最小值
</script>