有这么个需求:求n个数中最大数,
<script type="text/javascript"> function maxNumber(){ var maxNumber = arguments[0]; for (var i = arguments.length - 1; i >= 0; i--) { if(arguments[i] > maxNumber){ maxNumber =arguments[i]; } } return maxNumber; } var maxValue = maxNumber(1,2,3,4,45,5,3333); document.write(maxValue); </script>