SQL PHP HTML ASP JavaScript articles and free scripts to download
 

Math.max() JavaScript math function

We can use Math.max() JavaScript math function to get highest value from a set of numbers. Here is the syntax

Math.max(x1,x2,x3,….xn)

Here are some sample codes.

<script language='JavaScript' type='text/JavaScript'>
<!--
document.write(Math.max(3,12,4,14,7,5)); // output is 14
document.write("<br>");
document.write(Math.max(-5,6,-22,2,-20)); // output is 6
document.write("<br>");
document.write(Math.max(-12,-23,-3)); // output is -3
//-->
</script>

Found anything wrong or wants to improve the code by adding more features? Post your short comment here or use the Forum



Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked

Join Our Email List
Email:  
For Email Newsletters you can trust
Math functions
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2013 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer