How to use Math.min in JavaScript:- Geniusofstudent


  • This method will return the number with the lowest value.
  • If no arguments are provided, the result is Infinity.
  • If at least one of arguments cannot be converted to a number, the result is NaN.
  • Syntax 
    Math.min([value1[, value2[,..

  • Code:-

    1. <!DOCTYPE html> 
    2. <html> 
    3.  
    4. <head> 
    5.  <meta name="viewport" content="width=device-width, initial-scale=1"> 
    6. </head> 
    7.  
    8. <body> 
    9.  <h1>Math.min()</h1> 
    10.  
    11.  <input type="button" onclick="min_val();" value="Get Min"> 
    12.  
    13.  <script> 
    14.   function min_val() 
    15.   { 
    16.    alert("Min : " + Math.min(3, 4, 5, 6, -5)); 
    17.   } 
    18.  </script> 
    19.  
    20. </body> 
    21.  
    22. </html>
    How to use Math.min in JavaScript:- Geniusofstudent How to use Math.min in JavaScript:- Geniusofstudent Reviewed by Network security on July 02, 2019 Rating: 5

    No comments:

    Useful Information

    Powered by Blogger.