Math.floor() returns the largest integer less than or equal to a given number.

Math.floor() is understood to be rounded down.

The opposite is math.ceil (), which is rounded up.

The following code:

Math. Floor (45.95); / / 45 math.h floor (45.05); // 45 Math.floor( 4 ); / / 4 math.h floor (45.05); / / - 46 math.h floor (45.95); / / - 46Copy the code

The figure above illustrates some small comparisons of this function.

www.ossez.com/t/javascrip…