JavaScript Math floor() is an inbuilt function that is used to find the nearest integer less than the passed value(or equal to, if the passed value is itself an integer). Floor values are often required in various algorithm-building scenarios dealing with mathematical operations and can be directly seen in different mathematical formulae as well.

Javascript Math floor()

JavaScript floor() is the function that is used to return the largest integer value that is less than or equal to a number. In other words, the floor() function rounds a number down and returns an integer value. Since floor() is a static method of Math, it can be used without creating an  object.

Syntax

Math.floor(x)

#javascript

Javascript Math floor() Function | floor() in Javascript
2.60 GEEK