Números matemáticos
parseFloat('98.6'); // 98.6
parseFloat('98.6 is the average normal temperature of the human body'); // 98.6
Cruel Cormorant
parseFloat('98.6'); // 98.6
parseFloat('98.6 is the average normal temperature of the human body'); // 98.6
const eightAndAHalf = 8.5;
Number.isInteger(eightAndAHalf); // false
Number.isInteger(Math.floor(eightAndAHalf)); // true
// rounds a number down to the nearest integer
Math.floor(9.99); // 9
// rounds a number up to the nearest integer
Math.ceil(9.01); // 10
// rounds a number to the nearest integer
Math.round(9.51); // 10
// returns the largest of the numbers passed through it
Math.max(1, 2, 3, 4, 5); // 5
// returns the smallest of the numbers passed through it
Math.min(1, 2, 3, 4, 5); // 1
// returns a random number between 0 inclusive and 1 non-inclusive
Math.random(); // 0.31764219954126016
parseInt("100", 10); // 100
parseInt("100", 2); // 4 (100 in the binary system)