Here you can find a number of examples on Java Script.Please find the various kinds of examples listed on the right side of this site. If you don't find anything on Java Script then please write to us or leave a commnet. We are pleased to help and find the solution of your problem.

JavaScript: MAX Function



Math.max() Function:
Find the maximum number in the arraylist.
Syntax:
max(number,numner.........,number)

Description:
Because max is a static method of Math, you always use it as Math.max(), rather than as a method of a Math object you created.



Example:

<html>
<head>
<title>Math.max() Function</title>

<script language="javascript">
document.write("The maximum number is " + Math.max(5,8,10) + " from(5,8,10)
");
document.write("The maximum number is " + Math.max(-4,-7) + " from(-4,-7)
");
</script>

</head>
</html>



OUT PUT

The maximum number is 10 from(5,8,10)
The maximum number is -4 from(-4,-7)

1 comment:

Google