Converts value to a safe integer. A safe integer can be compared and represented correctly.
value
The value to convert.
Returns the converted integer.
_.toSafeInteger(3);// => 3_.toSafeInteger(Number.MIN_VALUE);// => 0_.toSafeInteger(Infinity);// => 9007199254740991_.toSafeInteger('3');// => 3 Copy
_.toSafeInteger(3);// => 3_.toSafeInteger(Number.MIN_VALUE);// => 0_.toSafeInteger(Infinity);// => 9007199254740991_.toSafeInteger('3');// => 3
Converts
value
to a safe integer. A safe integer can be compared and represented correctly.