JS Built-ins
← Math116 / 215
Mathfloorbeginner

Math.floor(4.9) Equals 4

πŸ“– Usage Example
// Round down to the nearest integer
Math.floor(4.9)   // β†’ 4
Math.floor(-4.1)  // β†’ -5

Use Math.floor() when you need to round a number down to the nearest whole integer.

Math.floor(x)

Rounds a number down to the nearest integer. Math.floor(4.9) returns 4.

Challenge: Use Math.floor() to round 4.9 down.

πŸ’‘ Hints (2)
  • β€’ floor always rounds toward -∞
  • β€’ Even 4.9999 floors down to 4