floor

The Math.floor() method rounds a number DOWN to the nearest integer.

Syntax

floor(x)

Returns

the value of x rounded down to its nearest integer

Parameters

x (float)
A number.