Lodash _.floor() Method
The _.floor() method is used to compute numbers rounded down to precision means it rounded down to the floor value.
_.floor(number, [precision = 0])
Parameters: This method accepts two parameters as mentioned above and described below:
- number: This parameter holds the number to round down.
- [precision = 0]: This parameter holds the precision to round down to.
Return Value: This method returns the rounded down number.
Example 1: Here, const _ = require(‘lodash’) is used to import the lodash library into the file.