JavaScript Math


The math is the object in Javascript. Which has properties and methods.

JavaScript uses JavaScript math objects to perform mathematical operations on numeric values.

There is no constructor for the Math object. Math This mathematical operation is performed on numeric values through properties and methods without creating an object.

Example

<script type="text/javascript">
	document.write(Math.round(4.49) + "<br />");
	document.write(Math.round(4.50) + "<br />");
	document.write(Math.round(4.51) + "<br />");
	document.write(Math.round(-4.50) + "<br />");
	document.write(Math.round(-4.49) + "<br />");
	document.write(Math.round(-4.51) + "<br />");
</script>