Thumb

JavaScript Math Object

1/22/2020 4:41:40 AM

JavaScript math object is pre define object we just use this function because our coding style will be simplified. If we use the function, we easily find the round figure of the digit or other facilities by the pre define function. Now given bellow some example code and explain the code:

<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
<script type="text/javascript">
console.log(Math.PI);
console.log(Math.round(4.4));
console.log(Math.pow(8, 2));
console.log(Math.ceil(4.4));
console.log(Math.min(0, 150, 30, 20, -8, -200));
console.log(Math.max(0, 150, 30, 20, -8, -200));
</script>
</body>
</html>

In this code we see the many type of function of the Math object. This function responsible to our code are more easily write and easily undatable. If we use the “Math.PI” function we get the PI value.