toInteger

Lang
since 4.0.0

Arguments

  • * The value to convert.

Returns

number the converted integer.

Converts value to an integer.

Note: This method is loosely based on ToInteger.

Example of Lodash _.toInteger

_.toInteger(3.2);
// => 3

_.toInteger(Number.MIN_VALUE);
// => 0

_.toInteger(Infinity);
// => 1.7976931348623157e+308

_.toInteger('3.2');
// => 3