Introduction to JS
Introduction Of Javascript
It is the type of an object which provides many constants and methods to perform the mathematical operations. Math objects do not use constructor.
Let's talk about some methods of Math object
Math.sqrt(n)
This method can find the square root of the given number
Let's take an example:-
Math.pow(m,n)
This method is used to get the power values .
Let's take an example:-
Math.random()
This method is used to get the random number 0 to 1.
Let's take an example:-
Some more methods and description below :-
Methods | Description |
---|---|
abs() | It returns the absolute value of the given number. |
acos() | It returns the arccosine of the given number in radians. |
ceil() | It returns a smallest integer value, greater than or equal to the given number. |
cos() | It returns the cosine of the given number. |
floor() | It returns largest integer value, lower than or equal to the given number. |
max() | It returns maximum value of the given numbers. |
min() | It returns minimum value of the given numbers. |
random() | It returns random number between 0 (inclusive) and 1 (exclusive). |
round() | It returns closest integer value of the given number. |
sqrt() | It returns the square root of the given number |
JS training insitute | Best IT Training classes in Gurgaon | Web Designing Training Institute