3 min read
Types of Number methods
With the generated random numbers, we can generate operations like multiplications, the sum of the numbers, an integer between two values Etc...
Math.random() * 100
var n = 12.7
typeof (x) :
var n1 = 10
var n2 = '20'
Math. abs() method is mainly used to return the absolute value of a number. Math.abs() uses a number as its parameter and returns its absolute value.
values = Math.abs(67);
console.log(values); // 67
value = Math.abs(-7);
console.log(value); // 7
Math ceil() :
Math ceil() method increases the value of the given input number up to the closest integer value and returns the Output value.
console. log(Math. ceil(.97)); // Expected output: 1.
Did you find this article valuable?
Support Skill Safari by becoming a sponsor. Any amount is appreciated!