Math.max() 返回参数列表中的最高值

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <h1>JavaScript Math.max()</h1>
  6.  
  7. <p>Math.max() 返回参数列表中的最高值:</p>
  8.  
  9. <p id="demo"></p>
  10.  
  11. <script>
  12. document.getElementById("demo").innerHTML =
  13. Math.max(0, 150, 30, 20, -8, -200);
  14. </script>
  15.  
  16. </body>
  17. </html>