JS MATH OBJECT (Properties and Methods for numbers) Flashcards
1
Q
PI Property
A
Math.PI. displays the mathematical constant pi in the console.
2
Q
Round Method
A
Math.round(argument);
Rounds the number to the nearest Integer (AKA NOT a decimal))
3
Q
Floor Method
A
Math.floor(argument);
Rounds the number down
Removes the numbers after the decimal on a positive number
4
Q
Ceil Method
A
Math.ceil(argument);
```
Rounds the number up to the nearest whole number
// Removes the numbers after the decimal on a negative number
~~~
5
Q
Random Method
A
Math.random(); (Returns a number from 0 up to less than 1) // NOTE: The Random Method does not accept an argument (Nothing inside of the parenthesis "()")
6
Q
Min Method
A
Math.min (argument); // Min Method (Returns the lowest number)
7
Q
Max Method
A
Math.max(argument);
Returns the highest number