READMEJavaScript

README

Module 08 Numbers Math / .2 Math Object

Concept Lesson
Intermediate
4 min

Learning Objective

Understand Module 08 Numbers Math well enough to explain it, recognize it in JavaScript, and apply it in a small task.

Why It Matters

This concept is part of the foundation that later lessons and projects assume you already understand.

Math Object StructureMathematical ConstantsRounding MethodsRounding To Decimal PlacesMin And Max
Private notes
0/8000

Notes stay private to your browser until account sync is configured.

README
2 min read18 headings

14.2 Math Object

Overview

The Math object in JavaScript provides a collection of properties and methods for mathematical constants and functions. Unlike other global objects, Math is not a constructorβ€”you use its methods directly.

Math Object Structure

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Math Object                               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Not a constructor - cannot use 'new Math()'                    β”‚
β”‚  All properties and methods are static                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚   Constants     β”‚    β”‚           Methods                   β”‚ β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚
β”‚  β”‚ Math.PI         β”‚    β”‚ Rounding: round, floor, ceil, trunc β”‚ β”‚
β”‚  β”‚ Math.E          β”‚    β”‚ Min/Max: min, max                   β”‚ β”‚
β”‚  β”‚ Math.LN2        β”‚    β”‚ Random: random                      β”‚ β”‚
β”‚  β”‚ Math.LN10       β”‚    β”‚ Power: pow, sqrt, cbrt, hypot       β”‚ β”‚
β”‚  β”‚ Math.LOG2E      β”‚    β”‚ Trig: sin, cos, tan, asin, etc.     β”‚ β”‚
β”‚  β”‚ Math.LOG10E     β”‚    β”‚ Log: log, log2, log10               β”‚ β”‚
β”‚  β”‚ Math.SQRT2      β”‚    β”‚ Other: abs, sign, exp, expm1        β”‚ β”‚
β”‚  β”‚ Math.SQRT1_2    β”‚    β”‚                                     β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Mathematical Constants

ConstantApproximate ValueDescription
Math.PI3.14159...Ratio of circumference to diameter
Math.E2.71828...Euler's number (natural log base)
Math.LN20.69314...Natural logarithm of 2
Math.LN102.30258...Natural logarithm of 10
Math.LOG2E1.44269...Base-2 logarithm of E
Math.LOG10E0.43429...Base-10 logarithm of E
Math.SQRT21.41421...Square root of 2
Math.SQRT1_20.70710...Square root of 1/2
console.log(Math.PI); // 3.141592653589793
console.log(Math.E); // 2.718281828459045
console.log(Math.SQRT2); // 1.4142135623730951

Rounding Methods

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Rounding Methods                             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚   Number Line:    -3    -2    -1     0     1     2     3        β”‚
β”‚                    β”œβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€        β”‚
β”‚                                                                  β”‚
β”‚   For 2.7:                                                       β”‚
β”‚   ─────────────────────────────────────────────────────────────  β”‚
β”‚   floor(2.7) = 2    ←── rounds toward -∞                        β”‚
β”‚   ceil(2.7) = 3     ←── rounds toward +∞                        β”‚
β”‚   round(2.7) = 3    ←── rounds to nearest (0.5 rounds up)       β”‚
β”‚   trunc(2.7) = 2    ←── removes decimal part                    β”‚
β”‚                                                                  β”‚
β”‚   For -2.7:                                                      β”‚
β”‚   ─────────────────────────────────────────────────────────────  β”‚
β”‚   floor(-2.7) = -3  ←── rounds toward -∞                        β”‚
β”‚   ceil(-2.7) = -2   ←── rounds toward +∞                        β”‚
β”‚   round(-2.7) = -3  ←── rounds to nearest                       β”‚
β”‚   trunc(-2.7) = -2  ←── removes decimal part                    β”‚
β”‚                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
// Math.round() - rounds to nearest integer
Math.round(2.4); // 2
Math.round(2.5); // 3
Math.round(2.6); // 3
Math.round(-2.5); // -2 (rounds toward +∞ at .5)

// Math.floor() - rounds down (toward -∞)
Math.floor(2.9); // 2
Math.floor(-2.1); // -3

// Math.ceil() - rounds up (toward +∞)
Math.ceil(2.1); // 3
Math.ceil(-2.9); // -2

// Math.trunc() - removes decimal part
Math.trunc(2.9); // 2
Math.trunc(-2.9); // -2

Rounding to Decimal Places

// Round to N decimal places
function roundTo(num, decimals) {
  const factor = Math.pow(10, decimals);
  return Math.round(num * factor) / factor;
}

roundTo(3.14159, 2); // 3.14
roundTo(3.14159, 4); // 3.1416

// Floor/Ceil to decimal places
function floorTo(num, decimals) {
  const factor = Math.pow(10, decimals);
  return Math.floor(num * factor) / factor;
}

function ceilTo(num, decimals) {
  const factor = Math.pow(10, decimals);
  return Math.ceil(num * factor) / factor;
}

Min and Max

// Find minimum and maximum
Math.min(1, 2, 3); // 1
Math.max(1, 2, 3); // 3

// With negative numbers
Math.min(-1, -5, 0); // -5
Math.max(-1, -5, 0); // 0

// With arrays (use spread operator)
const numbers = [5, 2, 8, 1, 9];
Math.min(...numbers); // 1
Math.max(...numbers); // 9

// Edge cases
Math.min(); // Infinity
Math.max(); // -Infinity
Math.min(1, NaN, 3); // NaN

Random Numbers

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Math.random()                                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚   Returns: 0 ≀ x < 1  (0 inclusive, 1 exclusive)                β”‚
β”‚                                                                  β”‚
β”‚   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”‚
β”‚   0                                                        1    β”‚
β”‚   β–²                                                              β”‚
β”‚   included                               not included ──────▢   β”‚
β”‚                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
// Basic random (0 to 1)
Math.random(); // e.g., 0.7234589012

// Random integer from 0 to max (exclusive)
function randomInt(max) {
  return Math.floor(Math.random() * max);
}
randomInt(10); // 0-9

// Random integer in range [min, max] (inclusive)
function randomRange(min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}
randomRange(1, 6); // 1-6 (dice roll)
randomRange(10, 20); // 10-20

// Random float in range
function randomFloat(min, max) {
  return Math.random() * (max - min) + min;
}
randomFloat(1.5, 3.5); // 1.5-3.5

// Random boolean
function randomBool() {
  return Math.random() < 0.5;
}

// Random array element
function randomElement(arr) {
  return arr[Math.floor(Math.random() * arr.length)];
}
randomElement(['a', 'b', 'c']); // Random pick

// Shuffle array (Fisher-Yates)
function shuffle(arr) {
  const result = [...arr];
  for (let i = result.length - 1; i > 0; i--) {
    const j = Math.floor(Math.random() * (i + 1));
    [result[i], result[j]] = [result[j], result[i]];
  }
  return result;
}

Power and Root Methods

MethodDescriptionExample
Math.pow(x, y)x raised to power yMath.pow(2, 3) β†’ 8
Math.sqrt(x)Square rootMath.sqrt(16) β†’ 4
Math.cbrt(x)Cube rootMath.cbrt(27) β†’ 3
Math.hypot(...values)HypotenuseMath.hypot(3, 4) β†’ 5
** operatorPower (ES2016)2 ** 3 β†’ 8
// Powers
Math.pow(2, 3); // 8 (2Β³)
Math.pow(2, 0.5); // 1.414... (square root)
2 ** 3; // 8 (ES2016 operator)
2 ** -1; // 0.5

// Roots
Math.sqrt(16); // 4
Math.sqrt(-1); // NaN
Math.cbrt(27); // 3
Math.cbrt(-8); // -2

// Hypotenuse (Pythagorean theorem)
Math.hypot(3, 4); // 5 (√(3² + 4²))
Math.hypot(5, 12); // 13

// Distance between two points
function distance(x1, y1, x2, y2) {
  return Math.hypot(x2 - x1, y2 - y1);
}
distance(0, 0, 3, 4); // 5

Absolute Value and Sign

// Absolute value
Math.abs(-5); // 5
Math.abs(5); // 5
Math.abs(-3.14); // 3.14

// Sign (returns -1, 0, or 1)
Math.sign(-5); // -1
Math.sign(0); // 0
Math.sign(5); // 1
Math.sign(-0); // -0

Exponential and Logarithmic

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Exponential and Logarithmic Functions              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚   Exponential:                    Logarithmic:                  β”‚
β”‚   ─────────────                   ────────────                  β”‚
β”‚   Math.exp(x) = eΛ£                Math.log(x) = ln(x)           β”‚
β”‚   Math.expm1(x) = eΛ£ - 1          Math.log1p(x) = ln(1 + x)     β”‚
β”‚                                   Math.log2(x) = logβ‚‚(x)        β”‚
β”‚                                   Math.log10(x) = log₁₀(x)      β”‚
β”‚                                                                  β”‚
β”‚   Relationship: if y = eΛ£ then x = ln(y)                        β”‚
β”‚                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
// Exponential
Math.exp(1); // 2.718... (eΒΉ)
Math.exp(2); // 7.389... (eΒ²)
Math.expm1(0); // 0 (e⁰ - 1)

// Natural logarithm (base e)
Math.log(Math.E); // 1
Math.log(1); // 0
Math.log(0); // -Infinity
Math.log(-1); // NaN

// Other logarithms
Math.log2(8); // 3 (2Β³ = 8)
Math.log10(1000); // 3 (10Β³ = 1000)

// Custom base logarithm
function logBase(x, base) {
  return Math.log(x) / Math.log(base);
}
logBase(8, 2); // 3

Trigonometric Functions

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Trigonometric Functions                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                  β”‚
β”‚   NOTE: All angles are in RADIANS, not degrees!                 β”‚
β”‚                                                                  β”‚
β”‚   Conversion:                                                    β”‚
β”‚   ───────────                                                    β”‚
β”‚   radians = degrees Γ— (Ο€ / 180)                                 β”‚
β”‚   degrees = radians Γ— (180 / Ο€)                                 β”‚
β”‚                                                                  β”‚
β”‚   Common Values:                                                 β”‚
β”‚   ──────────────                                                 β”‚
β”‚   0Β° = 0 rad       90Β° = Ο€/2 rad                                β”‚
β”‚   180Β° = Ο€ rad     360Β° = 2Ο€ rad                                β”‚
β”‚                                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
MethodDescription
Math.sin(x)Sine of x (radians)
Math.cos(x)Cosine of x
Math.tan(x)Tangent of x
Math.asin(x)Arcsine (inverse sine)
Math.acos(x)Arccosine
Math.atan(x)Arctangent
Math.atan2(y, x)Arctangent of y/x
Math.sinh(x)Hyperbolic sine
Math.cosh(x)Hyperbolic cosine
Math.tanh(x)Hyperbolic tangent
// Degree/Radian conversion
function toRadians(degrees) {
  return degrees * (Math.PI / 180);
}

function toDegrees(radians) {
  return radians * (180 / Math.PI);
}

// Basic trig functions
Math.sin(0); // 0
Math.sin(Math.PI / 2); // 1 (sin 90Β°)
Math.cos(0); // 1
Math.cos(Math.PI); // -1 (cos 180Β°)
Math.tan(Math.PI / 4); // 1 (tan 45Β°)

// Inverse trig functions
Math.asin(1); // 1.5707... (Ο€/2)
Math.acos(0); // 1.5707... (Ο€/2)
Math.atan(1); // 0.7853... (Ο€/4)

// atan2 - angle from origin to point (y, x)
Math.atan2(1, 1); // 0.7853... (45Β°)
Math.atan2(1, 0); // 1.5707... (90Β°)

Other Useful Methods

MethodDescriptionExample
Math.fround(x)Nearest 32-bit floatMath.fround(1.5) β†’ 1.5
Math.clz32(x)Leading zeros in 32-bitMath.clz32(1) β†’ 31
Math.imul(a, b)32-bit integer multiplyMath.imul(2, 4) β†’ 8

Practical Examples

Circle Calculations

function circleArea(radius) {
  return Math.PI * radius ** 2;
}

function circumference(radius) {
  return 2 * Math.PI * radius;
}

circleArea(5); // 78.539...
circumference(5); // 31.415...

Distance and Angles

// Distance between two points
function distance(x1, y1, x2, y2) {
  return Math.hypot(x2 - x1, y2 - y1);
}

// Angle between two points (in degrees)
function angle(x1, y1, x2, y2) {
  const radians = Math.atan2(y2 - y1, x2 - x1);
  return radians * (180 / Math.PI);
}

distance(0, 0, 3, 4); // 5
angle(0, 0, 1, 1); // 45

Clamping Values

function clamp(value, min, max) {
  return Math.min(Math.max(value, min), max);
}

clamp(150, 0, 100); // 100
clamp(-50, 0, 100); // 0
clamp(50, 0, 100); // 50

Linear Interpolation

function lerp(start, end, t) {
  return start + (end - start) * t;
}

lerp(0, 100, 0); // 0
lerp(0, 100, 0.5); // 50
lerp(0, 100, 1); // 100

Mapping Range

function mapRange(value, inMin, inMax, outMin, outMax) {
  return ((value - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin;
}

mapRange(50, 0, 100, 0, 1); // 0.5
mapRange(25, 0, 100, 0, 255); // 63.75

Key Takeaways

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       Math Object Summary                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  1. Math is not a constructor - use methods directly            β”‚
β”‚  2. Rounding: round, floor, ceil, trunc have different behavior β”‚
β”‚  3. Math.random() returns [0, 1) - includes 0, excludes 1       β”‚
β”‚  4. Trig functions use RADIANS, not degrees                     β”‚
β”‚  5. Use spread operator for min/max with arrays                 β”‚
β”‚  6. Math.hypot() is great for distance calculations             β”‚
β”‚  7. ES2016 ** operator is cleaner than Math.pow()               β”‚
β”‚  8. Math.sign() returns -1, 0, or 1                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Skill Check

Test this lesson

Answer 4 quick questions to lock in the lesson and feed your adaptive practice queue.

--
Score
0/4
Answered
Not attempted
Status
1

Which module does this lesson belong to?

2

Which section is covered in this lesson content?

3

Which term is most central to this lesson?

4

What is the best way to use this lesson for real learning?

Your answers save locally first, then sync when account storage is available.
Practice queue