JS Built-ins
← Math177 / 215
Mathroundbeginner

Math.round() β€” 4.4 rounds down

πŸ“– Usage Example
// Round to nearest integer (ties go up)
Math.round(4.5)   // β†’ 5
Math.round(4.4)   // β†’ 4

Use Math.round() to round a number to the nearest integer, with ties (.5) rounding up.

Math.round()

Returns the value of a number rounded to the nearest integer.

Challenge: Verify that Math.round(4.4) returns 4.

πŸ’‘ Hints (1)
  • β€’ Values below x.5 round toward the lower integer