JavaScript Math min 方法


JavaScript Math min 方法

<html>

   <head>
      <title>JavaScript Math min() Method</title>
   </head>

   <body>

      <script type = "text/javascript">
         var value = Math.min(10, 20, -1, 100);
         document.write("First Test Value : " + value );

         var value = Math.min(-1, -3, -40);
         document.write("<br />Second Test Value : " + value );

         var value = Math.min(0, -1);
         document.write("<br />Third Test Value : " + value );

         var value = Math.min(100);
         document.write("<br />Fourth Test Value : " + value );
      </script>

   </body>
</html>